Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Side by Side Diff: chrome/test/data/extensions/api_test/content_scripts/dont_match_host_permissions/background.js

Issue 8725019: Move another bunch of extension API tests to manifest_version 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 var receivedRequests = {};
6
7 chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
8 if (receivedRequests[request.source]) {
9 chrome.test.fail(
10 'Received multiple requests from "' + request.source + '".');
11 return;
12 }
13
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();
18 });
19
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
23 // modified.
24 chrome.test.getConfig(function(config) {
25 chrome.tabs.create({
26 url: 'http://a.com:' + config.testServer.port +
27 '/files/extensions/test_file.html'});
28 chrome.tabs.create({
29 url: 'http://b.com:' + config.testServer.port +
30 '/files/extensions/test_file.html'});
31 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698