Commit cb1b8105 authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[MD Extensions] Don't show the reload spinner for disabled extensions

Don't show the dev-mode reload spinner for disabled extensions. Update
tests to match.

Bug: 769539
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I16927e8faa9c4cbe69042d62b41c93df5ec714b8
Reviewed-on: https://chromium-review.googlesource.com/688682Reviewed-by: default avatarScott Chen <scottchen@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505130}
parent 3dd792ad
...@@ -282,11 +282,11 @@ cr.define('extensions', function() { ...@@ -282,11 +282,11 @@ cr.define('extensions', function() {
*/ */
computeDevReloadButtonHidden_: function() { computeDevReloadButtonHidden_: function() {
// Only display the reload spinner if the extension is unpacked and // Only display the reload spinner if the extension is unpacked and
// not terminated (since if it's terminated, we'll show a crashed reload // enabled. There's no point in reloading a disabled extension, and we'll
// buton). // show a crashed reload buton if it's terminated.
const showIcon = const showIcon =
this.data.location == chrome.developerPrivate.Location.UNPACKED && this.data.location == chrome.developerPrivate.Location.UNPACKED &&
this.data.state != chrome.developerPrivate.ExtensionState.TERMINATED; this.data.state == chrome.developerPrivate.ExtensionState.ENABLED;
return !showIcon; return !showIcon;
}, },
......
...@@ -110,10 +110,21 @@ cr.define('extension_item_tests', function() { ...@@ -110,10 +110,21 @@ cr.define('extension_item_tests', function() {
testNormalElementsAreVisible(item); testNormalElementsAreVisible(item);
testDeveloperElementsAreVisible(item); testDeveloperElementsAreVisible(item);
// Developer reload button should be visible only for enabled unpacked
// extensions.
extension_test_util.testVisible(item, '#dev-reload-button', false); extension_test_util.testVisible(item, '#dev-reload-button', false);
item.set('data.location', chrome.developerPrivate.Location.UNPACKED); item.set('data.location', chrome.developerPrivate.Location.UNPACKED);
Polymer.dom.flush(); Polymer.dom.flush();
extension_test_util.testVisible(item, '#dev-reload-button', true); extension_test_util.testVisible(item, '#dev-reload-button', true);
item.set('data.state', chrome.developerPrivate.ExtensionState.DISABLED);
Polymer.dom.flush();
extension_test_util.testVisible(item, '#dev-reload-button', false);
item.set('data.state', chrome.developerPrivate.ExtensionState.TERMINATED);
Polymer.dom.flush();
extension_test_util.testVisible(item, '#dev-reload-button', false);
}); });
/** Tests that the delegate methods are correctly called. */ /** Tests that the delegate methods are correctly called. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment