Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/inspector-unit/resources/inspector-unit-test-shell.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-unit/resources/inspector-unit-test-shell.html b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/resources/inspector-unit-test-shell.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..88df12fc48c971492482628a921982463e8f682c |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-unit/resources/inspector-unit-test-shell.html |
| @@ -0,0 +1,29 @@ |
| +<html> |
| +<head> |
| +<base href="/inspector-debug/"></base> |
| +<script src="/inspector-debug/Runtime.js"></script> |
| +<script src="/inspector-unit/inspector-unit-test.js"></script> |
| +<script> |
| +function getQueryParameter(queryParameter) { |
|
einbinder
2016/11/22 02:19:46
Runtime.queryParam?
chenwilliam
2016/11/22 20:56:05
Done.
|
| + var query = window.location.search.substring(1); |
| + var parameters = query.split('&'); |
| + for (var i = 0; i < parameters.length; i++) { |
| + var pair = parameters[i].split('='); |
| + if (decodeURIComponent(pair[0]) === queryParameter) |
| + return decodeURIComponent(pair[1]); |
| + } |
| + throw new Error(`Query parameter: ${queryParameter} not found`); |
| +} |
| + |
| +fetch(`/inspector-unit/${getQueryParameter('test')}`) |
| + .then((data) => data.text()) |
| + .then((testScript) => { |
| + eval(testScript); |
| + startTest(test); |
| + }); |
| +</script> |
| +</head> |
| +<body> |
| +</body> |
| +</html> |
| + |