1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 var testUrl
= 'http://a.com:PORT/';
7 chrome
.test
.getConfig(function(config
) {
8 testUrl
= testUrl
.replace(/PORT/, config
.testServer
.port
);
10 chrome
.tabs
.onUpdated
.addListener(function listener(tabId
, changeInfo
, tab
) {
11 if (changeInfo
.status
!= 'complete')
13 chrome
.tabs
.onUpdated
.removeListener(listener
);
15 chrome
.test
.runTests([
16 function executeJavaScriptFileWithBadEncodingShouldFail() {
17 chrome
.tabs
.executeScript(tabId
, {
18 file
: 'bad_encoding/bad_encoding.js'
19 }, chrome
.test
.callbackFail(
20 'Could not load file \'bad_encoding/bad_encoding.js\' for ' +
21 'content script. It isn\'t UTF-8 encoded.'));
26 chrome
.tabs
.create({ url
: testUrl
});