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

Side by Side Diff: chrome/test/data/extensions/api_test/messaging/connect_crash/test.js

Issue 1413543005: Use FrameTreeNode ID as frameId in extension APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 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
OLDNEW
(Empty)
1 // Copyright 2015 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 chrome.runtime.onConnect.addListener(function(port) {
6 var is_ready_to_crash = false;
7 var succeed1 = chrome.test.callbackAdded();
8 var succeed2 = chrome.test.callbackAdded();
9
10 port.onMessage.addListener(function(msg) {
11 chrome.test.assertEq('is_ready_to_crash', msg);
12 is_ready_to_crash = true;
13 chrome.test.sendMessage('ready_to_crash');
14 // Now the browser test should kill the tab, and the port should be closed.
15 });
16 port.onDisconnect.addListener(function() {
17 console.log('port.onDisconnect was triggered.');
Devlin 2015/12/10 21:53:06 chrome.test.log
robwu 2015/12/11 00:53:47 Done.
18 chrome.test.assertTrue(is_ready_to_crash);
19 succeed1();
20 });
21
22 chrome.tabs.sendMessage(port.sender.tab.id, 'Rob says hi', function() {
23 console.log('tab.sendMessage\'s response callback was invoked');
24 chrome.test.assertNoLastError();
25 succeed2();
26 });
27 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698