Commit 6b3f36e8 authored by Tim van der Lippe's avatar Tim van der Lippe Committed by Commit Bot

Remove runtime.js layout test

They are replaced by DevTools unittests in
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2406154

TBR=aerotwist@chromium.org

Change-Id: Iec1e479e8716f3656406efb3c55684cc188a5f4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404446Reviewed-by: default avatarTim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806168}
parent 4f09781b
This test checks various Runtime functions.
Running: substituteURL
"no url here" -> "no url here"
"@url()" -> "fake_module/"
"@url(file.js)" -> "fake_module/file.js"
"before @url(long/path/to/the/file.png) after" -> "before fake_module/long/path/to/the/file.png after"
"@url(first.png)@url(second.gif)" -> "fake_module/first.pngfake_module/second.gif"
"a lot of @url(stuff) in a@url(single)line and more url() @@url (not/a/resource.gif)" -> "a lot of fake_module/stuff in afake_module/singleline and more url() @@url (not/a/resource.gif)"
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`This test checks various Runtime functions.\n`);
function findLoadedModule() {
var modules = self.runtime._modules;
for (var module of modules) {
if (module._loadedForTest)
return module;
}
TestRunner.addResult('Fail: not a single module loaded');
TestRunner.completeTest();
}
TestRunner.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) {
TestRunner.addResult('"' + value + '" -> "' + module.substituteURL(value) + '"');
}
module._name = moduleName;
next();
}]);
})();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment