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

Unified Diff: third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js

Issue 2249043002: Disable WebShare on platforms other than android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js
diff --git a/third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js b/third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js
index 642561c7ab9c5a947e17a1d201161dbb2ebc5fa1..0079ff8069590279cdeb37ebf715485f42ca002f 100644
--- a/third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js
+++ b/third_party/WebKit/LayoutTests/webshare/resources/mock-share-service.js
@@ -67,10 +67,14 @@ function share_test(func, name, properties) {
// Copied from resources/bluetooth/bluetooth-helpers.js.
function callWithKeyDown(functionCalledOnKeyPress) {
- return new Promise(resolve => {
+ return new Promise((resolve, reject) => {
function onKeyPress() {
document.removeEventListener('keypress', onKeyPress, false);
- resolve(functionCalledOnKeyPress());
+ try {
+ resolve(functionCalledOnKeyPress());
+ } catch (e) {
+ reject(e);
+ }
}
document.addEventListener('keypress', onKeyPress, false);

Powered by Google App Engine
This is Rietveld 408576698