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

Side by Side Diff: chrome/test/data/extensions/api_test/content_scripts/all_frames/test.html

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
1 <script> 1 <!--
2 // We load a page that has one iframe 2 * Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this
3 // So we should receive two "all_frames" messages, and one "top_frame_only" 3 * source code is governed by a BSD-style license that can be found in the
4 // messages. 4 * LICENSE file.
5 5 -->
6 var num_all_frames_messages = 0; 6 <script src="test.js"></script>
7 var num_top_frame_only_messages = 0;
8
9 chrome.test.runTests([
10 // Tests receiving a request from a content script and responding.
11 function onRequest() {
12 chrome.extension.onRequest.addListener(
13 function(request, sender, sendResponse) {
14 if (request == "all_frames") {
15 num_all_frames_messages++;
16 } else if (request == "top_frame_only") {
17 num_top_frame_only_messages++;
18 } else {
19 chrome.test.fail("Unexpected request: " + JSON.stringify(request));
20 }
21
22 if (num_all_frames_messages == 2 && num_top_frame_only_messages == 1) {
23 chrome.test.succeed();
24 }
25 }
26 );
27 }
28 ]);
29
30 chrome.test.getConfig(function(config) {
31 chrome.test.log("Creating tab...");
32
33 var test_url =
34 "http://localhost:PORT/files/extensions/test_file_with_iframe.html"
35 .replace(/PORT/, config.testServer.port);
36
37 chrome.tabs.create({ url: test_url });
38 });
39
40 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698