Index: chrome/test/data/extensions/api_test/webstore_inline_install/set_invalid_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/set_invalid_listener.html |
similarity index 61% |
copy from chrome/test/data/extensions/api_test/webstore_inline_install/install.html |
copy to chrome/test/data/extensions/api_test/webstore_inline_install/set_invalid_listener.html |
index 6cf0f673749d7fd7afbddf9852bacfba61350fcc..d566e947c288ebd5af2d26f80b2d5b713db5382d 100644 |
--- a/chrome/test/data/extensions/api_test/webstore_inline_install/install.html |
+++ b/chrome/test/data/extensions/api_test/webstore_inline_install/set_invalid_listener.html |
@@ -5,10 +5,10 @@ |
</head> |
<body> |
<script> |
- console.log('Page loaded'); |
- |
function runTest(galleryUrl) { |
- console.log('In runTest'); |
+ var caughtError = false; |
+ var kExpectedErrorMessage = |
+ 'The listener callback for install stage change must be a function.'; |
// 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 +16,23 @@ |
galleryUrl + '/detail/ecglahbcnmdpdciemllbhojghbkagdje'; |
try { |
+ try { |
+ chrome.webstore.setInstallStageListener("not a function"); |
+ } catch (e) { |
+ if (e != kExpectedErrorMessage) { |
+ console.log('Unexpected error: ' + e); |
+ window.domAutomationController.send(false); |
+ } |
+ caughtError = true; |
+ } |
chrome.webstore.install( |
undefined, |
function() { |
- console.log('Ran test, sending response'); |
+ if (!caughtError) { |
+ console.log('Test failed: Did not catch error for invalid arg.'); |
+ window.domAutomationController.send(false); |
+ } |
window.domAutomationController.send(true); |
- console.log('Test complete'); |
}, |
function(error) { |
console.log('Unexpected error: ' + error); |
@@ -32,6 +43,7 @@ |
window.gc(); |
} catch (e) { |
console.log('Unexpected exception: ' + e); |
+ console.log(e.stack); |
window.domAutomationController.send(false); |
throw e; |
} |