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

Unified Diff: chrome/test/data/webui/settings/people_page_manage_profile_test.js

Issue 2950943002: MD Settings: Stop using IronMenuBehavior from cr-profile-avatar-selector-grid. (Closed)
Patch Set: Added comment. Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/webui/settings/people_page_manage_profile_test.js
diff --git a/chrome/test/data/webui/settings/people_page_manage_profile_test.js b/chrome/test/data/webui/settings/people_page_manage_profile_test.js
index 0af15d9bf1fccf4f341534d7912f39f87f03cc3d..09050485dc6de165cb97fac1778249cecafc338d 100644
--- a/chrome/test/data/webui/settings/people_page_manage_profile_test.js
+++ b/chrome/test/data/webui/settings/people_page_manage_profile_test.js
@@ -94,53 +94,33 @@ cr.define('settings_people_page_manage_profile', function() {
// Tests that the manage profile subpage
// - gets and receives all the available icons
- // - has the correct icon selected
// - can select a new icon
test('ManageProfileChangeIcon', function() {
- var selector = manageProfile.$.selector.$['avatar-grid'];
- assertTrue(!!selector);
-
+ var items = null;
return browserProxy.whenCalled('getAvailableIcons')
.then(function() {
Polymer.dom.flush();
+ items = manageProfile.$.selector.$['avatar-grid'].
+ querySelectorAll('.avatar');
- assertEquals('fake-icon-1.png', manageProfile.profileIconUrl);
- assertEquals(3, selector.items.length);
- assertTrue(selector.items[0].classList.contains('iron-selected'));
- assertFalse(
- selector.items[1].classList.contains('iron-selected'));
- assertFalse(
- selector.items[2].classList.contains('iron-selected'));
+ // Initially no item is selected, because of crbug.com/710660.
+ assertFalse(!!manageProfile.profileAvatar);
+ assertEquals(3, items.length);
+ assertFalse(items[0].classList.contains('iron-selected'));
+ assertFalse(items[1].classList.contains('iron-selected'));
+ assertFalse(items[2].classList.contains('iron-selected'));
- MockInteractions.tap(selector.items[1]);
+ MockInteractions.tap(items[1]);
return browserProxy.whenCalled('setProfileIconToDefaultAvatar');
})
.then(function(args) {
assertEquals('fake-icon-2.png', args[0]);
- MockInteractions.tap(selector.items[2]);
+ MockInteractions.tap(items[2]);
return browserProxy.whenCalled('setProfileIconToGaiaAvatar');
});
});
- // Tests profile icon updates pushed from the browser.
- test('ManageProfileIconUpdated', function() {
- var selector = manageProfile.$.selector.$['avatar-grid'];
- assertTrue(!!selector);
-
- return browserProxy.whenCalled('getAvailableIcons').then(function() {
- manageProfile.profileIconUrl = 'fake-icon-2.png';
-
- Polymer.dom.flush();
-
- assertEquals('fake-icon-2.png', manageProfile.profileIconUrl);
- assertEquals(3, selector.items.length);
- assertFalse(selector.items[0].classList.contains('iron-selected'));
- assertTrue(selector.items[1].classList.contains('iron-selected'));
- assertFalse(selector.items[2].classList.contains('iron-selected'));
- });
- });
-
test('ManageProfileChangeName', function() {
var nameField = manageProfile.$.name;
assertTrue(!!nameField);

Powered by Google App Engine
This is Rietveld 408576698