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

Unified 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, 5 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/console/console-last-result.html
diff --git a/LayoutTests/inspector/console/console-last-result.html b/LayoutTests/inspector/console/console-last-result.html
index 7464587ba3a712a689a294bdc47d45619ad8f702..f0ff30f97a558743de67af47ee84fd1ef49ebcec 100644
--- a/LayoutTests/inspector/console/console-last-result.html
+++ b/LayoutTests/inspector/console/console-last-result.html
@@ -6,17 +6,44 @@
function test()
{
- InspectorTest.evaluateInConsole("1+1", step1);
+ InspectorTest.runTestSuite([
+ function testLastResult(next)
+ {
+ InspectorTest.evaluateInConsole("1+1", step1);
- function step1()
- {
- InspectorTest.evaluateInConsole("$_", callback);
- }
+ function step1()
+ {
+ evaluateLastResultAndDump(next);
+ }
+ },
+
+ function testLastResultAfterConsoleClear(next)
+ {
+ InspectorTest.evaluateInConsole("1+1", step1);
- function callback()
+ function step1()
+ {
+ WebInspector.consoleModel.requestClearMessages();
+ InspectorTest.runAfterPendingDispatches(step2);
+ }
+
+ function step2()
+ {
+ evaluateLastResultAndDump(next);
+ }
+ }
+ ]);
+
+ function evaluateLastResultAndDump(callback)
{
- InspectorTest.dumpConsoleMessages();
- InspectorTest.completeTest();
+ InspectorTest.evaluateInConsole("$_", didEvaluate);
+
+ function didEvaluate()
+ {
+ InspectorTest.dumpConsoleMessages();
+ if (callback)
+ callback();
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698