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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js

Issue 2513423003: DevTools: Convert inspector-unit tests to use reusable test harness (Closed)
Patch Set: clean diff Created 4 years, 1 month 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/http/tests/inspector-unit/inspector-unit-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js
index bb1ca19ec5297f1f2e8ea5a0e52e668b39523f21..c4daa5897b6fbc30a4aa453040604078a37a5647 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/inspector-unit-test.js
@@ -1,6 +1,6 @@
var UnitTest = {};
-(function()
-{
+var startTest;
+(function() {
var lazyModules = [];
var oldLoadResourcePromise = Runtime.loadResourcePromise;
Runtime.loadResourcePromise = function(url)
@@ -14,10 +14,11 @@ var UnitTest = {};
var parsedURL = new URL(url, location.href);
var parsedLocation = new URL(location.href);
+ parsedURL.pathname = parsedURL.pathname.replace('/resources/', '/');
// hosted devtools is confused.
parsedURL.pathname = parsedURL.pathname.replace('/inspector-unit/', '/inspector-debug/');
return oldLoadResourcePromise(parsedURL.toString());
- }
+ };
if (window.testRunner) {
testRunner.dumpAsText();
@@ -123,9 +124,11 @@ var UnitTest = {};
}
window.onerror = completeTestOnError;
- Runtime.startApplication("/inspector-unit/inspector-unit-test").then(runTest);
+ startTest = function (test) {
+ Runtime.startApplication("/inspector-unit/inspector-unit-test").then(() => runTest(test));
einbinder 2016/11/22 02:19:45 Maybe don't force things to be wrapped in function
chenwilliam 2016/11/22 20:56:05 Done.
+ };
- function runTest()
+ function runTest(test)
{
var description = document.body.textContent.trim();
if (description)

Powered by Google App Engine
This is Rietveld 408576698