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

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

Issue 3353015: Implement gallery install API (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: erik comments Created 10 years, 3 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/extension.cc ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <script>
2 // This tests that the management install and uninstall functions work
3 // properly when called by the gallery. Additionally, it implicitly tests
4 // that the install() function, when called from the gallery, avoids the
5 // dangerous download prompt and the extension permissions install prompt.
6 // If either were to appear, this test wouldn't complete.
7 // Note that for the purposes of this test the gallery url is "www.a.com"
8 // which is set in extension_gallery_install_apitest.cc.
9
10 var id = "ldnnhddmnhbkjipkidpdiheffobcpfmf";
11
12 function checkInstalled(callback) {
13 chrome.experimental.management.getAll(function(extensions) {
14 var found = false;
15 extensions.forEach(function(extension) {
16 if (id == extension.id)
17 found = true;
18 });
19
20 callback(found);
21 });
22 }
23
24 // Make sure our "gallery" extension isn't yet installed.
25 checkInstalled(function(installed) {
26 chrome.test.assertEq(false, installed);
27
28 // Install "gallery" extensions.
29 chrome.experimental.management.onInstalled.addListener(function(info) {
30 chrome.test.assertEq(id, info.id);
31 console.log("Installed " + info.id);
32
33 // Double check it is installed.
34 checkInstalled(function(installed) {
35 chrome.test.assertEq(true, installed);
36
37 // Now uninstall
38 chrome.experimental.management.onUninstalled.addListener(function() {
39 // And check that it's gone.
40 checkInstalled(function(installed) {
41 chrome.test.assertEq(false, installed);
42
43 chrome.test.succeed();
44 });
45 });
46
47 console.log("Uninstalling...");
48 chrome.experimental.management.uninstall(id, function() {
49 chrome.test.assertNoLastError();
50 });
51 });
52 });
53 chrome.webstorePrivate.install(id, function() {
54 chrome.test.assertNoLastError();
55 });
56 console.log("Installing...");
57 });
58 </script>
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698