OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015 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. | |
4 | |
5 chrome.test.getConfig(function(config) { | |
6 var baseUrl = 'http://example.com:' + config.testServer.port; | |
7 var pageUrl = baseUrl + '/extensions/test_file.html?open-to-finish-test'; | |
8 | |
9 var x = new XMLHttpRequest(); | |
10 x.open('GET', baseUrl + '/extensions/test_file.txt?extension'); | |
11 x.onloadend = function() { | |
12 // Just a sanity check to ensure that the server is running. | |
13 // The test does not change the response. | |
14 chrome.test.assertEq('Hello!', x.responseText); | |
15 | |
16 chrome.webNavigation.onCompleted.addListener(function(details) { | |
17 // After creating the tab, the onBeforeRequest event in the | |
18 // eavesdropping extension should be triggered. | |
19 chrome.test.sendMessage('extension_done'); | |
not at google - send to devlin
2015/08/04 20:27:02
good practice to remove listener after this.
robwu
2015/08/04 21:57:24
I've removed the tab-load detection from the page,
| |
20 }, { | |
21 url: [{ | |
22 urlEquals: pageUrl | |
23 }] | |
24 }); | |
25 chrome.tabs.create({ | |
26 url: pageUrl | |
27 }); | |
28 }; | |
29 x.send(); | |
30 }); | |
OLD | NEW |