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

Unified Diff: LayoutTests/inspector/sources/debugger/frameworks-blackbox-patterns.html

Issue 548323002: DevTools: Blackbox content scripts - frontend. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: added a test Created 6 years, 3 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
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/frameworks-blackbox-patterns-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/sources/debugger/frameworks-blackbox-patterns.html
diff --git a/LayoutTests/inspector/sources/debugger/frameworks-blackbox-patterns.html b/LayoutTests/inspector/sources/debugger/frameworks-blackbox-patterns.html
new file mode 100644
index 0000000000000000000000000000000000000000..d07adf527a061e3ea643a02e53cb9d4a8a442c05
--- /dev/null
+++ b/LayoutTests/inspector/sources/debugger/frameworks-blackbox-patterns.html
@@ -0,0 +1,42 @@
+<html>
+<head>
+<script src="../../../http/tests/inspector/inspector-test.js"></script>
+<script>
+
+function test()
+{
+ var testCases = [
+ "http://www.example.com/foo/jquery-1.7-min.js", "/jquery\\-1\\.7\\-min\\.js$",
+ "https://www.example.com/jquery.js?version=1.7", "/jquery\\.js\\b",
+ "http://www.google.com/jsapi", "/jsapi$",
+ "https://www.google.com/jsapi/", "/jsapi/$",
+ "data:text/html,foo", "",
+ "about:blank", "",
+ "chrome-extension://extensionName/main.js", "^chrome-extension://extensionName\\b.*/main\\.js$",
+ "extensions::unload_events", "^extensions::unload_events$",
+ ];
+
+ for (var i = 0; i < testCases.length; i += 2) {
+ var url = testCases[i];
+ InspectorTest.addResult("Testing " + url);
+ var regexValue = WebInspector.BlackboxSupport._urlToRegExpString(url);
+ InspectorTest.assertEquals(testCases[i + 1], regexValue);
+ if (!regexValue)
+ continue;
+ var regex = new RegExp(regexValue);
+ InspectorTest.assertTrue(regex.test(url), "FAIL: Generated RegExp does not match the URL");
+ }
+
+ InspectorTest.addResult("\nPASS");
+ InspectorTest.completeTest();
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests framework blackbox patterns for various URLs.
+</p>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/frameworks-blackbox-patterns-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698