OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
Devlin
2015/11/13 21:16:27
nit: no (c) (everywhere)
robwu
2015/12/07 23:44:22
Done.
| |
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 port = chrome.runtime.connect(); | |
6 port.onDisconnect.addListener(function() { | |
7 chrome.test.fail('onDisconnect should not be triggered because the ' + | |
8 'background page exists and the tab should have been crashed'); | |
9 }); | |
10 | |
11 var ref; | |
12 chrome.runtime.onMessage.addListener(function(msg, sender, sendResponse) { | |
13 chrome.test.assertEq('Rob says hi', msg); | |
14 port.postMessage('is_ready_to_crash'); | |
15 // Keep the callback around to avoid test flakiness due to GC. | |
16 ref = sendResponse; | |
17 | |
18 // TODO(robwu): Remove the following line once crbug.com/439780 is fixed. | |
19 // (the response callback is not automatically invoked when the tab crashes). | |
20 sendResponse(); | |
21 | |
22 // Keep the port open - do not send a response. | |
23 return true; | |
24 }); | |
OLD | NEW |