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

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

Issue 412008: Introduce a new 'all_frames' property to content scripts and (Closed)
Patch Set: responses to comments Created 11 years, 1 month 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
OLDNEW
(Empty)
1 <script>
2 // We load a page that has one iframe
3 // So we should receive two "all_frames" messages, and one "top_frame_only"
4 // messages.
5
6 var num_all_frames_messages = 0;
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.log("Creating tab...");
31 chrome.tabs.create({
32 url: "http://localhost:1337/files/extensions/test_file_with_iframe.html"
33 });
34 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698