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

Side by Side Diff: chrome/test/data/extensions/api_test/webstore_inline_install/double_install.html

Issue 2103663002: [Extensions] Rework inline installation observation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missingfile Created 4 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 unified diff | Download patch
« no previous file with comments | « chrome/common/extensions/webstore_install_result.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <link rel="chrome-webstore-item">
5 </head>
6 <body>
7 <script>
8 function runTest(galleryUrl) {
9 // Link URL has to be generated dynamically in order to include the right
10 // port number. The ID corresponds to the data in the "extension" directory.
11 document.getElementsByTagName('link')[0].href =
12 galleryUrl + '/detail/ecglahbcnmdpdciemllbhojghbkagdje';
13
14 try {
15 chrome.webstore.install(
16 undefined,
17 function() {},
18 function() {});
19 chrome.webstore.install(
20 undefined,
21 function() {
22 console.log('Unexpected success');
23 window.domAutomationController.send(false);
24 },
25 function(errorMessage, errorCode) {
26 var success = errorCode == 3; // Install in progress error.
27 if (!success)
28 console.log('Unexpected error: ' + errorMessage);
29 window.domAutomationController.send(success);
30 });
31 } catch (e) {
32 // Yuck. We can throw this "already installing" error either from the
33 // renderer (if we catch the fact that it's already installing early) or
34 // from the browser. In the first case, it's a thrown error, and in the
35 // second, it triggers the callback from chrome.webstore.install. And to
36 // top it off, they're different messages. Unfortunately, it's hard to say
37 // which, if either, we can change, since someone may be relying on one or
38 // the other.
39 // TODO(devlin): Make this less bad somehow. crbug.com/624614
40 var success =
41 e.message == 'A Chrome Web Store installation is already pending.';
42 if (!success)
43 console.log('Unexpected exception: ' + e);
44 window.domAutomationController.send(success);
45 }
46 }
47 </script>
48
49 </body>
50 </html>
OLDNEW
« no previous file with comments | « chrome/common/extensions/webstore_install_result.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698