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

Unified Diff: chrome/test/data/webui/extensions/extension_manager_test.js

Issue 2526893002: [MD Extensions] Update subpages when the backing extension data changes (Closed)
Patch Set: Michael's Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/extensions/cr_extensions_browsertest.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/extensions/extension_manager_test.js
diff --git a/chrome/test/data/webui/extensions/extension_manager_test.js b/chrome/test/data/webui/extensions/extension_manager_test.js
index 5e99cf68e4078a7307230eba431a76fa01fa08fd..9b93e8af1c196747af71594729d6b87476aa5a4e 100644
--- a/chrome/test/data/webui/extensions/extension_manager_test.js
+++ b/chrome/test/data/webui/extensions/extension_manager_test.js
@@ -11,6 +11,7 @@ cr.define('extension_manager_tests', function() {
ShowItems: 'show items',
ChangePages: 'change pages',
UrlNavigationToDetails: 'url navigation to details',
+ UpdateItemData: 'update item data',
};
function getDataByName(list, name) {
@@ -159,6 +160,47 @@ cr.define('extension_manager_tests', function() {
var detailsView = manager.$['details-view'];
expectEquals('ldnnhddmnhbkjipkidpdiheffobcpfmf', detailsView.data.id);
});
+
+ test(assert(TestNames.UpdateItemData), function() {
+ var oldDescription = 'old description';
+ var newDescription = 'new description';
+ var extension = extension_test_util.createExtensionInfo(
+ {description: oldDescription});
+ var secondExtension = extension_test_util.createExtensionInfo({
+ description: 'irrelevant',
+ id: 'b'.repeat(32),
+ });
+ manager.addItem(extension);
+ manager.addItem(secondExtension);
+ var data = manager.extensions[0];
+ manager.showItemDetails(extension);
+ var detailsView = manager.$['details-view'];
+ expectEquals(extension.id, detailsView.data.id);
+ expectEquals(oldDescription, detailsView.data.description);
+ expectEquals(
+ oldDescription,
+ detailsView.$$('.section .section-content').textContent.trim());
+
+ var extensionCopy = Object.assign({}, extension);
+ extensionCopy.description = newDescription;
+ manager.updateItem(extensionCopy);
+ expectEquals(extension.id, detailsView.data.id);
+ expectEquals(newDescription, detailsView.data.description);
+ expectEquals(
+ newDescription,
+ detailsView.$$('.section .section-content').textContent.trim());
+
+ // Updating a different extension shouldn't have any impact.
+ var secondExtensionCopy = Object.assign({}, secondExtension);
+ secondExtensionCopy.description = 'something else';
+ manager.updateItem(secondExtensionCopy);
+ expectEquals(extension.id, detailsView.data.id);
+ expectEquals(newDescription, detailsView.data.description);
+ expectEquals(
+ newDescription,
+ detailsView.$$('.section .section-content').textContent.trim());
+
+ });
});
}
« no previous file with comments | « chrome/test/data/webui/extensions/cr_extensions_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698