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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html

Issue 1707043002: [DevTools] Support CommandLineAPI in snippets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html
index 1786ee9810e18a71d65b8967d0a1c2df62f23111..f8df38e6d728124031d59e0a730f2bac57343a4a 100644
--- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html
+++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html
@@ -147,14 +147,14 @@ function test()
InspectorTest.addResult("Snippet3 created.");
WebInspector.scriptSnippetModel.project().deleteFile(uiSourceCode3.url());
InspectorTest.addResult("Snippet3 deleted.");
-
+
InspectorTest.addResult("Number of uiSourceCodes in workspace: " + workspace.uiSourceCodes().filter(filterSnippet).length);
var storageSnippetsCount = WebInspector.scriptSnippetModel._snippetStorage.snippets().length;
InspectorTest.addResult("Number of snippets in the storage: " + storageSnippetsCount);
-
+
workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, uiSourceCodeAdded);
workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved, uiSourceCodeRemoved);
-
+
next();
}
},
@@ -163,13 +163,14 @@ function test()
{
var uiSourceCode1;
var uiSourceCode2;
+ var uiSoruceCode3;
var context = WebInspector.context.flavor(WebInspector.ExecutionContext);
resetSnippetsSettings();
var snippetScriptMapping = WebInspector.scriptSnippetModel.snippetScriptMapping(WebInspector.targetManager.targets()[0]);
WebInspector.scriptSnippetModel.project().createFile("", null, "", step2.bind(this));
-
+
function step2(uiSourceCode)
{
uiSourceCode1 = uiSourceCode;
@@ -180,7 +181,7 @@ function test()
uiSourceCode1.setWorkingCopy(content);
WebInspector.scriptSnippetModel.project().createFile("", null, "", step3.bind(this));
}
-
+
function step3(uiSourceCode)
{
uiSourceCode2 = uiSourceCode;
@@ -192,17 +193,28 @@ function test()
content += "};\n";
content += "doesNothing;\n";
uiSourceCode2.setWorkingCopy(content);
- evaluateSnippetAndDumpEvaluationDetails(uiSourceCode1, context, step4);
+ WebInspector.scriptSnippetModel.project().createFile("", null, "", step4.bind(this));
}
- function step4()
+ function step4(uiSourceCode)
{
- evaluateSnippetAndDumpEvaluationDetails(uiSourceCode2, context, step5);
+ uiSourceCode3 = uiSourceCode;
+ uiSourceCode3.rename("Snippet3", function() { });
+ content = "";
+ content += "// This snippet uses Command Line API.\n";
+ content += "$$(\"p\").length";
+ uiSourceCode3.setWorkingCopy(content);
+ evaluateSnippetAndDumpEvaluationDetails(uiSourceCode1, context, step5);
}
function step5()
{
- evaluateSnippetAndDumpEvaluationDetails(uiSourceCode1, context, next);
dgozman 2016/02/17 23:47:43 Bring this one back.
kozy 2016/02/18 00:27:33 Done.
+ evaluateSnippetAndDumpEvaluationDetails(uiSourceCode2, context, step6);
+ }
+
+ function step6()
+ {
+ evaluateSnippetAndDumpEvaluationDetails(uiSourceCode3, context, next);
}
},
@@ -226,7 +238,7 @@ function test()
var snippetScriptMapping = WebInspector.scriptSnippetModel.snippetScriptMapping(WebInspector.targetManager.targets()[0]);
WebInspector.scriptSnippetModel.project().createFile("", null, "", step3.bind(this));
-
+
function step3(uiSourceCode)
{
var uiSourceCode1 = uiSourceCode;

Powered by Google App Engine
This is Rietveld 408576698