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

Side by Side Diff: chrome/test/data/extensions/api_test/content_scripts/all_frames/test.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 // We load a page that has one iframe
6 // So we should receive two "all_frames" messages, and one "top_frame_only"
7 // messages.
8
9 var num_all_frames_messages = 0;
10 var num_top_frame_only_messages = 0;
11
12 chrome.test.runTests([
13 // Tests receiving a request from a content script and responding.
14 function onRequest() {
15 chrome.extension.onRequest.addListener(
16 function(request, sender, sendResponse) {
17 if (request == "all_frames") {
18 num_all_frames_messages++;
19 } else if (request == "top_frame_only") {
20 num_top_frame_only_messages++;
21 } else {
22 chrome.test.fail("Unexpected request: " + JSON.stringify(request));
23 }
24
25 if (num_all_frames_messages == 2 && num_top_frame_only_messages == 1) {
26 chrome.test.succeed();
27 }
28 }
29 );
30 }
31 ]);
32
33 chrome.test.getConfig(function(config) {
34 chrome.test.log("Creating tab...");
35
36 var test_url =
37 "http://localhost:PORT/files/extensions/test_file_with_iframe.html"
38 .replace(/PORT/, config.testServer.port);
39
40 chrome.tabs.create({ url: test_url });
41 });
42
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698