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

Unified Diff: chrome/browser/extensions/service_worker_apitest.cc

Issue 1256323008: [Extension ServiceWorkers] Chrome: Passing v8::context to extensions dispatcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
Index: chrome/browser/extensions/service_worker_apitest.cc
diff --git a/chrome/browser/extensions/service_worker_apitest.cc b/chrome/browser/extensions/service_worker_apitest.cc
index 3dd54521a95d4a5eb90781c951e71333d5a3b97a..065f6e202631dd94dfd10abb18cb61724c1f9b88 100644
--- a/chrome/browser/extensions/service_worker_apitest.cc
+++ b/chrome/browser/extensions/service_worker_apitest.cc
@@ -64,4 +64,29 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerTest, ServiceWorkerFetchEvent) {
EXPECT_EQ("Caught a fetch!", output);
}
+// Binding that was created on the v8::Context of the worker for testing
+// purposes
+// should bind 42 to chrome.
+IN_PROC_BROWSER_TEST_F(ServiceWorkerTest, ServiceWorkerChromeBinding) {
+ ASSERT_TRUE(RunExtensionTest("service_worker/bindings")) << message_;
+ content::WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ content::WaitForLoadStop(contents);
+
+ std::string output;
+ ASSERT_TRUE(content::ExecuteScriptAndExtractString(
+ contents, "window.domAutomationController.send(document.body.innerText);",
+ &output));
+ EXPECT_EQ("No Fetch Event yet.", output);
+
+ // Page must reload in order for the service worker to take control.
+ contents->GetController().Reload(true);
+ content::WaitForLoadStop(contents);
+
+ ASSERT_TRUE(content::ExecuteScriptAndExtractString(
+ contents, "window.domAutomationController.send(document.body.innerText);",
+ &output));
+ EXPECT_EQ("true", output);
+}
+
} // namespace extensions
« no previous file with comments | « no previous file | chrome/renderer/chrome_content_renderer_client.h » ('j') | chrome/renderer/chrome_content_renderer_client.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698