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

Unified Diff: chrome/test/data/extensions/api_test/service_worker/payments/page.js

Issue 2880133002: PaymentHandler: Should not allow accessing PaymentManager in Extension.
Patch Set: typo Created 3 years, 7 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/test/data/extensions/api_test/service_worker/payments/page.js
diff --git a/chrome/test/data/extensions/api_test/service_worker/payments/page.js b/chrome/test/data/extensions/api_test/service_worker/payments/page.js
new file mode 100644
index 0000000000000000000000000000000000000000..16851d94578cc0cbe42473ad17d9d6dfebcd64f2
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/service_worker/payments/page.js
@@ -0,0 +1,16 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+window.runServiceWorker = function() {
+ navigator.serviceWorker.register('sw.js').then(function() {
+ return navigator.serviceWorker.ready;
+ }).then(function(registration) {
+ console.log(registration.paymentManager);
+ return registration.active;
+ }).then(function(paymentManager) {
+ window.domAutomationController.send(paymentManager);
+ }).catch(function(error) {
+ window.domAutomationController.send(error.name);
+ });
+};

Powered by Google App Engine
This is Rietveld 408576698