Index: chrome/test/data/extensions/api_test/webstore_inline_install/download_progress_listener.html |
diff --git a/chrome/test/data/extensions/api_test/webstore_inline_install/install.html b/chrome/test/data/extensions/api_test/webstore_inline_install/download_progress_listener.html |
similarity index 63% |
copy from chrome/test/data/extensions/api_test/webstore_inline_install/install.html |
copy to chrome/test/data/extensions/api_test/webstore_inline_install/download_progress_listener.html |
index 6cf0f673749d7fd7afbddf9852bacfba61350fcc..6bb40453f610e242977256a01eb64dfdab24b3ac 100644 |
--- a/chrome/test/data/extensions/api_test/webstore_inline_install/install.html |
+++ b/chrome/test/data/extensions/api_test/webstore_inline_install/download_progress_listener.html |
@@ -5,10 +5,8 @@ |
</head> |
<body> |
<script> |
- console.log('Page loaded'); |
- |
function runTest(galleryUrl) { |
- console.log('In runTest'); |
+ var receivedProgressUpdate = false; |
// Link URL has to be generated dynamically in order to include the right |
// port number. The ID corresponds to the data in the "extension" directory. |
@@ -16,12 +14,22 @@ |
galleryUrl + '/detail/ecglahbcnmdpdciemllbhojghbkagdje'; |
try { |
+ chrome.webstore.setDownloadProgressListener(function(progress) { |
+ if (progress < 0 || progress > 1.0) { |
+ console.log('Received invalid download progress: ' + progress); |
+ window.domAutomationController.send(false); |
+ } |
+ receivedProgressUpdate = true; |
+ }); |
chrome.webstore.install( |
undefined, |
function() { |
- console.log('Ran test, sending response'); |
+ if (!receivedProgressUpdate) { |
+ console.log( |
+ 'Test Failed: Did not receive download progress update.'); |
+ window.domAutomationController.send(false); |
+ } |
window.domAutomationController.send(true); |
- console.log('Test complete'); |
}, |
function(error) { |
console.log('Unexpected error: ' + error); |
@@ -32,6 +40,7 @@ |
window.gc(); |
} catch (e) { |
console.log('Unexpected exception: ' + e); |
+ console.log(e.stack); |
window.domAutomationController.send(false); |
throw e; |
} |