2 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * @fileoverview This file contains small testing framework along with the
34 * test suite for the frontend. These tests are a part of the continues build
35 * and are executed by the devtools_sanity_unittest.cc as a part of the
36 * Interactive UI Test suite.
37 * FIXME: change field naming style to use trailing underscore.
40 if (window.domAutomationController) {
42 var ___interactiveUiTestsMode = true;
45 * Test suite for interactive UI tests.
48 TestSuite = function()
50 this.controlTaken_ = false;
56 * Reports test failure.
57 * @param {string} message Failure description.
59 TestSuite.prototype.fail = function(message)
61 if (this.controlTaken_)
62 this.reportFailure_(message);
69 * Equals assertion tests that expected === actual.
70 * @param {!Object} expected Expected object.
71 * @param {!Object} actual Actual object.
72 * @param {string} opt_message User message to print if the test fails.
74 TestSuite.prototype.assertEquals = function(expected, actual, opt_message)
76 if (expected !== actual) {
77 var message = "Expected: '" + expected + "', but was '" + actual + "'";
79 message = opt_message + "(" + message + ")";
85 * True assertion tests that value == true.
86 * @param {!Object} value Actual object.
87 * @param {string} opt_message User message to print if the test fails.
89 TestSuite.prototype.assertTrue = function(value, opt_message)
91 this.assertEquals(true, !!value, opt_message);
96 * HasKey assertion tests that object has given key.
97 * @param {!Object} object
100 TestSuite.prototype.assertHasKey = function(object, key)
102 if (!object.hasOwnProperty(key))
103 this.fail("Expected object to contain key '" + key + "'");
108 * Contains assertion tests that string contains substring.
109 * @param {string} string Outer.
110 * @param {string} substring Inner.
112 TestSuite.prototype.assertContains = function(string, substring)
114 if (string.indexOf(substring) === -1)
115 this.fail("Expected to: '" + string + "' to contain '" + substring + "'");
120 * Takes control over execution.
122 TestSuite.prototype.takeControl = function()
124 this.controlTaken_ = true;
125 // Set up guard timer.
127 this.timerId_ = setTimeout(function() {
128 self.reportFailure_("Timeout exceeded: 20 sec");
134 * Releases control over execution.
136 TestSuite.prototype.releaseControl = function()
138 if (this.timerId_ !== -1) {
139 clearTimeout(this.timerId_);
147 * Async tests use this one to report that they are completed.
149 TestSuite.prototype.reportOk_ = function()
151 window.domAutomationController.send("[OK]");
156 * Async tests use this one to report failures.
158 TestSuite.prototype.reportFailure_ = function(error)
160 if (this.timerId_ !== -1) {
161 clearTimeout(this.timerId_);
164 window.domAutomationController.send("[FAILED] " + error);
169 * Runs all global functions starting with "test" as unit tests.
171 TestSuite.prototype.runTest = function(testName)
175 if (!this.controlTaken_)
178 this.reportFailure_(e);
184 * @param {string} panelName Name of the panel to show.
186 TestSuite.prototype.showPanel = function(panelName)
188 // Open Scripts panel.
189 var button = document.getElementById("tab-" + panelName);
190 button.selectTabForTest();
191 this.assertEquals(WebInspector.panels[panelName], WebInspector.inspectorView.currentPanel());
196 * Overrides the method with specified name until it's called first time.
197 * @param {!Object} receiver An object whose method to override.
198 * @param {string} methodName Name of the method to override.
199 * @param {!Function} override A function that should be called right after the
200 * overridden method returns.
201 * @param {boolean} opt_sticky Whether restore original method after first run
204 TestSuite.prototype.addSniffer = function(receiver, methodName, override, opt_sticky)
206 var orig = receiver[methodName];
207 if (typeof orig !== "function")
208 this.fail("Cannot find method to override: " + methodName);
210 receiver[methodName] = function(var_args) {
212 var result = orig.apply(this, arguments);
215 receiver[methodName] = orig;
217 // In case of exception the override won't be called.
219 override.apply(this, arguments);
221 test.fail("Exception in overriden method '" + methodName + "': " + e);
228 * Waits for current throttler invocations, if any.
229 * @param {!WebInspector.Throttler} throttler
230 * @param {!function} callback
232 TestSuite.prototype.waitForThrottler = function(throttler, callback)
235 var scheduleShouldFail = true;
236 test.addSniffer(throttler, "schedule", onSchedule);
238 function hasSomethingScheduled()
240 return throttler._isRunningProcess || throttler._process;
243 function checkState()
245 if (!hasSomethingScheduled()) {
246 scheduleShouldFail = false;
251 test.addSniffer(throttler, "_processCompletedForTests", checkState);
254 function onSchedule()
256 if (scheduleShouldFail)
257 test.fail("Unexpected Throttler.schedule");
267 * Tests that scripts tab can be open and populated with inspected scripts.
269 TestSuite.prototype.testShowScriptsTab = function()
271 this.showPanel("sources");
273 // There should be at least main page script.
274 this._waitUntilScriptsAreParsed(["debugger_test_page.html"],
276 test.releaseControl();
278 // Wait until all scripts are added to the debugger.
284 * Tests that scripts tab is populated with inspected scripts even if it
285 * hadn't been shown by the moment inspected paged refreshed.
286 * @see http://crbug.com/26312
288 TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh = function()
291 this.assertEquals(WebInspector.panels.elements, WebInspector.inspectorView.currentPanel(), "Elements panel should be current one.");
293 WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, waitUntilScriptIsParsed);
295 // Reload inspected page. It will reset the debugger agent.
296 test.evaluateInConsole_("window.location.reload(true);", function(resultText) {});
298 function waitUntilScriptIsParsed()
300 WebInspector.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, waitUntilScriptIsParsed);
301 test.showPanel("sources");
302 test._waitUntilScriptsAreParsed(["debugger_test_page.html"],
304 test.releaseControl();
308 // Wait until all scripts are added to the debugger.
314 * Tests that scripts list contains content scripts.
316 TestSuite.prototype.testContentScriptIsPresent = function()
318 this.showPanel("sources");
321 test._waitUntilScriptsAreParsed(
322 ["page_with_content_script.html", "simple_content_script.js"],
324 test.releaseControl();
327 // Wait until all scripts are added to the debugger.
333 * Tests that scripts are not duplicaed on Scripts tab switch.
335 TestSuite.prototype.testNoScriptDuplicatesOnPanelSwitch = function()
339 // There should be two scripts: one for the main page and another
340 // one which is source of console API(see
341 // InjectedScript._ensureCommandLineAPIInstalled).
342 var expectedScriptsCount = 2;
343 var parsedScripts = [];
345 this.showPanel("sources");
347 function switchToElementsTab() {
348 test.showPanel("elements");
349 setTimeout(switchToScriptsTab, 0);
352 function switchToScriptsTab() {
353 test.showPanel("sources");
354 setTimeout(checkScriptsPanel, 0);
357 function checkScriptsPanel() {
358 test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html"]), "Some scripts are missing.");
360 test.releaseControl();
363 function checkNoDuplicates() {
364 var uiSourceCodes = test.nonAnonymousUISourceCodes_();
365 for (var i = 0; i < uiSourceCodes.length; i++) {
366 var scriptName = uiSourceCodes[i].url;
367 for (var j = i + 1; j < uiSourceCodes.length; j++)
368 test.assertTrue(scriptName !== uiSourceCodes[j].url, "Found script duplicates: " + test.uiSourceCodesToString_(uiSourceCodes));
372 test._waitUntilScriptsAreParsed(
373 ["debugger_test_page.html"],
376 setTimeout(switchToElementsTab, 0);
380 // Wait until all scripts are added to the debugger.
385 // Tests that debugger works correctly if pause event occurs when DevTools
386 // frontend is being loaded.
387 TestSuite.prototype.testPauseWhenLoadingDevTools = function()
389 this.showPanel("sources");
391 // Script execution can already be paused.
392 if (WebInspector.debuggerModel.debuggerPausedDetails)
395 this._waitForScriptPause(this.releaseControl.bind(this));
400 // Tests that pressing "Pause" will pause script execution if the script
401 // is already running.
402 TestSuite.prototype.testPauseWhenScriptIsRunning = function()
404 this.showPanel("sources");
406 this.evaluateInConsole_(
407 'setTimeout("handleClick()" , 0)',
408 didEvaluateInConsole.bind(this));
410 function didEvaluateInConsole(resultText) {
411 this.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText);
412 // Wait for some time to make sure that inspected page is running the
414 setTimeout(testScriptPause.bind(this), 300);
417 function testScriptPause() {
418 // The script should be in infinite loop. Click "Pause" button to
419 // pause it and wait for the result.
420 WebInspector.panels.sources._pauseButton.element.click();
422 this._waitForScriptPause(this.releaseControl.bind(this));
430 * Tests network size.
432 TestSuite.prototype.testNetworkSize = function()
436 function finishResource(resource, finishTime)
438 test.assertEquals(219, resource.transferSize, "Incorrect total encoded data length");
439 test.assertEquals(25, resource.resourceSize, "Incorrect total data length");
440 test.releaseControl();
443 this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishNetworkRequest", finishResource);
445 // Reload inspected page to sniff network events
446 test.evaluateInConsole_("window.location.reload(true);", function(resultText) {});
453 * Tests network sync size.
455 TestSuite.prototype.testNetworkSyncSize = function()
459 function finishResource(resource, finishTime)
461 test.assertEquals(219, resource.transferSize, "Incorrect total encoded data length");
462 test.assertEquals(25, resource.resourceSize, "Incorrect total data length");
463 test.releaseControl();
466 this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishNetworkRequest", finishResource);
468 // Send synchronous XHR to sniff network events
469 test.evaluateInConsole_("var xhr = new XMLHttpRequest(); xhr.open(\"GET\", \"chunked\", false); xhr.send(null);", function() {});
476 * Tests network raw headers text.
478 TestSuite.prototype.testNetworkRawHeadersText = function()
482 function finishResource(resource, finishTime)
484 if (!resource.responseHeadersText)
485 test.fail("Failure: resource does not have response headers text");
486 test.assertEquals(164, resource.responseHeadersText.length, "Incorrect response headers text length");
487 test.releaseControl();
490 this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishNetworkRequest", finishResource);
492 // Reload inspected page to sniff network events
493 test.evaluateInConsole_("window.location.reload(true);", function(resultText) {});
500 * Tests network timing.
502 TestSuite.prototype.testNetworkTiming = function()
506 function finishResource(resource, finishTime)
508 // Setting relaxed expectations to reduce flakiness.
509 // Server sends headers after 100ms, then sends data during another 100ms.
510 // We expect these times to be measured at least as 70ms.
511 test.assertTrue(resource.timing.receiveHeadersEnd - resource.timing.connectStart >= 70,
512 "Time between receiveHeadersEnd and connectStart should be >=70ms, but was " +
513 "receiveHeadersEnd=" + resource.timing.receiveHeadersEnd + ", connectStart=" + resource.timing.connectStart + ".");
514 test.assertTrue(resource.responseReceivedTime - resource.startTime >= 0.07,
515 "Time between responseReceivedTime and startTime should be >=0.07s, but was " +
516 "responseReceivedTime=" + resource.responseReceivedTime + ", startTime=" + resource.startTime + ".");
517 test.assertTrue(resource.endTime - resource.startTime >= 0.14,
518 "Time between endTime and startTime should be >=0.14s, but was " +
519 "endtime=" + resource.endTime + ", startTime=" + resource.startTime + ".");
521 test.releaseControl();
524 this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishNetworkRequest", finishResource);
526 // Reload inspected page to sniff network events
527 test.evaluateInConsole_("window.location.reload(true);", function(resultText) {});
533 TestSuite.prototype.testConsoleOnNavigateBack = function()
535 if (WebInspector.multitargetConsoleModel.messages().length === 1)
536 firstConsoleMessageReceived.call(this);
538 WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, firstConsoleMessageReceived, this);
540 function firstConsoleMessageReceived() {
541 WebInspector.multitargetConsoleModel.removeEventListener(WebInspector.ConsoleModel.Events.MessageAdded, firstConsoleMessageReceived, this);
542 this.evaluateInConsole_("clickLink();", didClickLink.bind(this));
545 function didClickLink() {
546 // Check that there are no new messages(command is not a message).
547 this.assertEquals(3, WebInspector.multitargetConsoleModel.messages().length);
548 this.evaluateInConsole_("history.back();", didNavigateBack.bind(this));
551 function didNavigateBack()
553 // Make sure navigation completed and possible console messages were pushed.
554 this.evaluateInConsole_("void 0;", didCompleteNavigation.bind(this));
557 function didCompleteNavigation() {
558 this.assertEquals(7, WebInspector.multitargetConsoleModel.messages().length);
559 this.releaseControl();
565 TestSuite.prototype.testReattachAfterCrash = function()
567 PageAgent.navigate("about:crash");
568 PageAgent.navigate("about:blank");
569 WebInspector.runtimeModel.addEventListener(WebInspector.RuntimeModel.Events.ExecutionContextCreated, this.releaseControl, this);
573 TestSuite.prototype.testSharedWorker = function()
575 function didEvaluateInConsole(resultText) {
576 this.assertEquals("2011", resultText);
577 this.releaseControl();
579 this.evaluateInConsole_("globalVar", didEvaluateInConsole.bind(this));
584 TestSuite.prototype.testPauseInSharedWorkerInitialization = function()
586 if (WebInspector.debuggerModel.debuggerPausedDetails)
588 this._waitForScriptPause(this.releaseControl.bind(this));
592 TestSuite.prototype.enableTouchEmulation = function()
594 WebInspector.targetManager.mainTarget().domModel.emulateTouchEventObjects(true);
598 // Regression test for crbug.com/370035.
599 TestSuite.prototype.testDeviceMetricsOverrides = function()
601 const dumpPageMetrics = function()
603 return JSON.stringify({
604 width: window.innerWidth,
605 height: window.innerHeight,
606 deviceScaleFactor: window.devicePixelRatio
612 function testOverrides(params, metrics, callback)
614 PageAgent.invoke_setDeviceMetricsOverride(params, getMetrics);
616 function getMetrics()
618 test.evaluateInConsole_("(" + dumpPageMetrics.toString() + ")()", checkMetrics);
621 function checkMetrics(consoleResult)
623 test.assertEquals('"' + JSON.stringify(metrics) + '"', consoleResult, "Wrong metrics for params: " + JSON.stringify(params));
630 testOverrides({width: 1200, height: 1000, deviceScaleFactor: 1, mobile: false, fitWindow: true}, {width: 1200, height: 1000, deviceScaleFactor: 1}, step2);
635 testOverrides({width: 1200, height: 1000, deviceScaleFactor: 1, mobile: false, fitWindow: false}, {width: 1200, height: 1000, deviceScaleFactor: 1}, step3);
640 testOverrides({width: 1200, height: 1000, deviceScaleFactor: 3, mobile: false, fitWindow: true}, {width: 1200, height: 1000, deviceScaleFactor: 3}, step4);
645 testOverrides({width: 1200, height: 1000, deviceScaleFactor: 3, mobile: false, fitWindow: false}, {width: 1200, height: 1000, deviceScaleFactor: 3}, finish);
650 test.releaseControl();
653 WebInspector.overridesSupport._deviceMetricsChangedListenerMuted = true;
655 this.waitForThrottler(WebInspector.overridesSupport._deviceMetricsThrottler, step1);
658 TestSuite.prototype.waitForTestResultsInConsole = function()
660 var messages = WebInspector.multitargetConsoleModel.messages();
661 for (var i = 0; i < messages.length; ++i) {
662 var text = messages[i].messageText;
665 else if (/^FAIL/.test(text))
666 this.fail(text); // This will throw.
668 // Neither PASS nor FAIL, so wait for more messages.
669 function onConsoleMessage(event)
671 var text = event.data.messageText;
673 this.releaseControl();
674 else if (/^FAIL/.test(text))
678 WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, onConsoleMessage, this);
682 TestSuite.prototype.checkLogAndErrorMessages = function()
684 var messages = WebInspector.multitargetConsoleModel.messages();
686 var matchesCount = 0;
687 function validMessage(message)
689 if (message.text === "log" && message.level === WebInspector.ConsoleMessage.MessageLevel.Log) {
694 if (message.text === "error" && message.level === WebInspector.ConsoleMessage.MessageLevel.Error) {
701 for (var i = 0; i < messages.length; ++i) {
702 if (validMessage(messages[i]))
704 this.fail(messages[i].text + ":" + messages[i].level); // This will throw.
707 if (matchesCount === 2)
710 // Wait for more messages.
711 function onConsoleMessage(event)
713 var message = event.data;
714 if (validMessage(message)) {
715 if (matchesCount === 2) {
716 this.releaseControl();
720 this.fail(message.text + ":" + messages[i].level);
723 WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, onConsoleMessage, this);
728 * Serializes array of uiSourceCodes to string.
729 * @param {!Array.<!WebInspectorUISourceCode>} uiSourceCodes
732 TestSuite.prototype.uiSourceCodesToString_ = function(uiSourceCodes)
735 for (var i = 0; i < uiSourceCodes.length; i++)
736 names.push('"' + uiSourceCodes[i].url + '"');
737 return names.join(",");
742 * Returns all loaded non anonymous uiSourceCodes.
743 * @return {!Array.<!WebInspectorUISourceCode>}
745 TestSuite.prototype.nonAnonymousUISourceCodes_ = function()
747 function filterOutAnonymous(uiSourceCode)
749 return !!uiSourceCode.url;
752 function filterOutService(uiSourceCode)
754 return !uiSourceCode.project().isServiceProject();
757 var uiSourceCodes = WebInspector.workspace.uiSourceCodes();
758 uiSourceCodes = uiSourceCodes.filter(filterOutService);
759 return uiSourceCodes.filter(filterOutAnonymous);
764 * Evaluates the code in the console as if user typed it manually and invokes
765 * the callback when the result message is received and added to the console.
766 * @param {string} code
767 * @param {function(string)} callback
769 TestSuite.prototype.evaluateInConsole_ = function(code, callback)
771 function innerEvaluate()
773 WebInspector.console.show();
774 var consoleView = WebInspector.ConsolePanel._view();
775 consoleView._prompt.text = code;
776 consoleView._promptElement.dispatchEvent(TestSuite.createKeyEvent("Enter"));
778 this.addSniffer(WebInspector.ConsoleView.prototype, "_showConsoleMessage",
779 function(viewMessage) {
780 callback(viewMessage.toMessageElement().textContent);
784 if (!WebInspector.context.flavor(WebInspector.ExecutionContext)) {
785 WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, innerEvaluate, this);
789 innerEvaluate.call(this);
793 * Checks that all expected scripts are present in the scripts list
794 * in the Scripts panel.
795 * @param {!Array.<string>} expected Regular expressions describing
796 * expected script names.
797 * @return {boolean} Whether all the scripts are in "scripts-files" select
800 TestSuite.prototype._scriptsAreParsed = function(expected)
802 var uiSourceCodes = this.nonAnonymousUISourceCodes_();
803 // Check that at least all the expected scripts are present.
804 var missing = expected.slice(0);
805 for (var i = 0; i < uiSourceCodes.length; ++i) {
806 for (var j = 0; j < missing.length; ++j) {
807 if (uiSourceCodes[i].name().search(missing[j]) !== -1) {
808 missing.splice(j, 1);
813 return missing.length === 0;
818 * Waits for script pause, checks expectations, and invokes the callback.
819 * @param {function():void} callback
821 TestSuite.prototype._waitForScriptPause = function(callback)
823 function pauseListener(event) {
824 WebInspector.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, pauseListener, this);
827 WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, pauseListener, this);
832 * Waits until all the scripts are parsed and asynchronously executes the code
833 * in the inspected page.
835 TestSuite.prototype._executeCodeWhenScriptsAreParsed = function(code, expectedScripts)
839 function executeFunctionInInspectedPage() {
840 // Since breakpoints are ignored in evals' calculate() function is
841 // execute after zero-timeout so that the breakpoint is hit.
842 test.evaluateInConsole_(
843 'setTimeout("' + code + '" , 0)',
844 function(resultText) {
845 test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText + ". Code: " + code);
849 test._waitUntilScriptsAreParsed(expectedScripts, executeFunctionInInspectedPage);
854 * Waits until all the scripts are parsed and invokes the callback.
856 TestSuite.prototype._waitUntilScriptsAreParsed = function(expectedScripts, callback)
860 function waitForAllScripts() {
861 if (test._scriptsAreParsed(expectedScripts))
864 test.addSniffer(WebInspector.panels.sources.sourcesView(), "_addUISourceCode", waitForAllScripts);
872 * Key event with given key identifier.
874 TestSuite.createKeyEvent = function(keyIdentifier)
876 var evt = document.createEvent("KeyboardEvent");
877 evt.initKeyboardEvent("keydown", true /* can bubble */, true /* can cancel */, null /* view */, keyIdentifier, "");
883 * Test runner for the test suite.
889 * Run each test from the test suit on a fresh instance of the suite.
891 uiTests.runAllTests = function()
893 // For debugging purposes.
894 for (var name in TestSuite.prototype) {
895 if (name.substring(0, 4) === "test" && typeof TestSuite.prototype[name] === "function")
896 uiTests.runTest(name);
902 * Run specified test on a fresh instance of the test suite.
903 * @param {string} name Name of a test method from TestSuite class.
905 uiTests.runTest = function(name)
907 if (uiTests._populatedInterface)
908 new TestSuite().runTest(name);
910 uiTests._pendingTestName = name;
917 uiTests._populatedInterface = true;
918 var name = uiTests._pendingTestName;
919 delete uiTests._pendingTestName;
921 new TestSuite().runTest(name);
924 WebInspector.notifications.addEventListener(WebInspector.NotificationService.Events.InspectorAgentEnabledForTests, runTests);