blob: 040246dc76e3bdf85f763768cbb9cf62806e4235 [file] [log] [blame]
<html>
<head>
<script src="../http/tests/inspector/inspector-test.js"></script>
<script>
function test()
{
function findLoadedModule()
{
var modules = self.runtime._modules;
for (var module of modules) {
if (module._loaded)
return module;
}
InspectorTest.addResult("Fail: not a single module loaded");
InspectorTest.completeTest();
}
InspectorTest.runTestSuite([
function substituteURL(next)
{
var module = findLoadedModule();
var moduleName = module._name;
module._name = "fake_module";
testValue("no url here");
testValue("@url()");
testValue("@url(file.js)");
testValue("before @url(long/path/to/the/file.png) after");
testValue("@url(first.png)@url(second.gif)");
testValue("a lot of @url(stuff) in a@url(single)line and more url() @@url (not/a/resource.gif)");
function testValue(value)
{
InspectorTest.addResult("\"" + value + "\" -> \"" + module.substituteURL(value) + "\"");
}
module._name = moduleName;
next();
}
]);
}
</script>
</head>
<body onload="runTest()">
<p>
This test checks various Runtime functions.
</p>
</body>
</html>