Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1080)

Side by Side Diff: LayoutTests/inspector/console/console-last-result.html

Issue 430503002: DevTools: Remove console last result $_ on console clear. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix test Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script> 4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script> 5 <script>
6 6
7 function test() 7 function test()
8 { 8 {
9 InspectorTest.evaluateInConsole("1+1", step1); 9 InspectorTest.runTestSuite([
10 function testLastResult(next)
11 {
12 InspectorTest.evaluateInConsole("1+1", step1);
10 13
11 function step1() 14 function step1()
15 {
16 evaluateLastResultAndDump(next);
17 }
18 },
19
20 function testLastResultAfterConsoleClear(next)
21 {
22 InspectorTest.evaluateInConsole("1+1", step1);
23
24 function step1()
25 {
26 WebInspector.consoleModel.requestClearMessages();
27 InspectorTest.runAfterPendingDispatches(step2);
28 }
29
30 function step2()
31 {
32 evaluateLastResultAndDump(next);
33 }
34 }
35 ]);
36
37 function evaluateLastResultAndDump(callback)
12 { 38 {
13 InspectorTest.evaluateInConsole("$_", callback); 39 InspectorTest.evaluateInConsole("$_", didEvaluate);
14 }
15 40
16 function callback() 41 function didEvaluate()
17 { 42 {
18 InspectorTest.dumpConsoleMessages(); 43 InspectorTest.dumpConsoleMessages();
19 InspectorTest.completeTest(); 44 if (callback)
45 callback();
46 }
20 } 47 }
21 } 48 }
22 49
23 </script> 50 </script>
24 </head> 51 </head>
25 52
26 <body onload="runTest()"> 53 <body onload="runTest()">
27 <p> 54 <p>
28 Tests that console exposes last evaluation result as $_. 55 Tests that console exposes last evaluation result as $_.
29 </p> 56 </p>
30 57
31 </body> 58 </body>
32 </html> 59 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698