1 // Copyright (c) 2011 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 receivedRequests = {};
7 chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
8 if (receivedRequests[request.source]) {
10 'Received multiple requests from "' + request.source + '".');
14 chrome.test.assertEq(request.source == 'a.com', request.modified);
15 receivedRequests[request.source] = true;
16 if (receivedRequests['a.com'] && receivedRequests['b.com'])
17 chrome.test.succeed();
20 // We load two pages. On a.com, both our modify and test script will run and we
21 // will receive a request that says that the page was modified. On b.com, only
22 // the test script will run, and the request will say that the page was not
24 chrome.test.getConfig(function(config) {
26 url: 'http://a.com:' + config.testServer.port +
27 '/extensions/test_file.html'});
29 url: 'http://b.com:' + config.testServer.port +
30 '/extensions/test_file.html'});