OLD | NEW |
1 <script> | 1 <!-- |
2 chrome.test.runTests([ | 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this |
3 function noContentScriptsInViewSource() { | 3 * source code is governed by a BSD-style license that can be found in the |
4 | 4 * LICENSE file. |
5 chrome.extension.onRequest.addListener( | 5 --> |
6 function(request, sender, sendResponse) { | 6 <script src="background.js"></script> |
7 chrome.test.fail('Got a content script request from view source mode.'); | |
8 }); | |
9 | |
10 // We rely on content scripts running at document_start to run before we | |
11 // receive a tab update with 'complete' status. | |
12 | |
13 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { | |
14 if (changeInfo.status === 'complete' && | |
15 tab.url.indexOf('test_file.html') != -1) { | |
16 chrome.test.succeed(); | |
17 } | |
18 }); | |
19 | |
20 chrome.test.getConfig(function(config) { | |
21 chrome.tabs.create({ | |
22 url: 'view-source:http://localhost:' + config.testServer.port + | |
23 '/files/extensions/test_file.html'}); | |
24 }); | |
25 } | |
26 ]); | |
27 | |
28 </script> | |
OLD | NEW |