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

Unified Diff: chrome/test/data/extensions/api_test/messaging/connect/test.js

Issue 1625993002: Mark opener extension port as opened after creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/messaging/connect/page.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/messaging/connect/test.js
diff --git a/chrome/test/data/extensions/api_test/messaging/connect/test.js b/chrome/test/data/extensions/api_test/messaging/connect/test.js
index 356f3d69505d36927590da6e9bffb17c4e81a44f..6956e82191273a743fe5d6ead328b5f9fce75e72 100644
--- a/chrome/test/data/extensions/api_test/messaging/connect/test.js
+++ b/chrome/test/data/extensions/api_test/messaging/connect/test.js
@@ -275,8 +275,26 @@ chrome.test.getConfig(function(config) {
.postMessage({testConnectChildFrameAndNavigateSetup: true});
},
+ // The previous test removed the onConnect listener. Add it back.
+ function reloadTabForTest() {
+ var doneListening = listenForever(chrome.tabs.onUpdated,
+ function(tabId, info) {
+ if (tabId === testTab.id && info.status == 'complete') {
+ doneListening();
+ }
+ });
+ chrome.tabs.reload(testTab.id);
+ },
+
// Tests that we get the disconnect event when the tab context closes.
function disconnectOnClose() {
+ listenOnce(chrome.runtime.onConnect, function(portFromTab) {
+ listenOnce(portFromTab.onDisconnect, function() {
+ chrome.test.assertNoLastError();
+ });
+ portFromTab.postMessage('unloadTabContent');
+ });
+
var port = chrome.tabs.connect(testTab.id);
port.postMessage({testDisconnectOnClose: true});
listenOnce(port.onDisconnect, function() {
« no previous file with comments | « chrome/test/data/extensions/api_test/messaging/connect/page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698