OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** @type {?SettingsAndroidAppsPageElement} */ | 5 /** @type {?SettingsAndroidAppsPageElement} */ |
6 var androidAppsPage = null; | 6 var androidAppsPage = null; |
7 | 7 |
8 /** @type {?TestAndroidAppsBrowserProxy} */ | 8 /** @type {?TestAndroidAppsBrowserProxy} */ |
9 var androidAppsBrowserProxy = null; | 9 var androidAppsBrowserProxy = null; |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 window.removeEventListener('popstate', callback); | 69 window.removeEventListener('popstate', callback); |
70 resolve(); | 70 resolve(); |
71 }); | 71 }); |
72 }); | 72 }); |
73 } | 73 } |
74 | 74 |
75 setup(function() { | 75 setup(function() { |
76 androidAppsPage.havePlayStoreApp = true; | 76 androidAppsPage.havePlayStoreApp = true; |
77 androidAppsPage.prefs = {arc: {enabled: {value: true}}}; | 77 androidAppsPage.prefs = {arc: {enabled: {value: true}}}; |
78 setAndroidAppsState(true, false); | 78 setAndroidAppsState(true, false); |
79 settings.navigateTo(settings.Route.ANDROID_APPS); | 79 settings.navigateTo(settings.routes.ANDROID_APPS); |
80 MockInteractions.tap(androidAppsPage.$$('#android-apps')); | 80 MockInteractions.tap(androidAppsPage.$$('#android-apps')); |
81 Polymer.dom.flush(); | 81 Polymer.dom.flush(); |
82 subpage = androidAppsPage.$$('settings-android-apps-subpage'); | 82 subpage = androidAppsPage.$$('settings-android-apps-subpage'); |
83 assertTrue(!!subpage); | 83 assertTrue(!!subpage); |
84 }); | 84 }); |
85 | 85 |
86 test('Sanity', function() { | 86 test('Sanity', function() { |
87 assertTrue(!!subpage.$$('#remove')); | 87 assertTrue(!!subpage.$$('#remove')); |
88 assertTrue(!subpage.$$('settings-android-settings-element')); | 88 assertTrue(!subpage.$$('settings-android-settings-element')); |
89 }); | 89 }); |
(...skipping 30 matching lines...) Expand all Loading... |
120 assertTrue(!!remove); | 120 assertTrue(!!remove); |
121 | 121 |
122 subpage.onRemoveTap_(); | 122 subpage.onRemoveTap_(); |
123 Polymer.dom.flush(); | 123 Polymer.dom.flush(); |
124 assertTrue(dialog.open); | 124 assertTrue(dialog.open); |
125 dialog.close(); | 125 dialog.close(); |
126 }); | 126 }); |
127 | 127 |
128 test('HideOnDisable', function() { | 128 test('HideOnDisable', function() { |
129 assertEquals(settings.getCurrentRoute(), | 129 assertEquals(settings.getCurrentRoute(), |
130 settings.Route.ANDROID_APPS_DETAILS); | 130 settings.routes.ANDROID_APPS_DETAILS); |
131 setAndroidAppsState(false, false); | 131 setAndroidAppsState(false, false); |
132 return whenPopState().then(function() { | 132 return whenPopState().then(function() { |
133 assertEquals(settings.getCurrentRoute(), | 133 assertEquals(settings.getCurrentRoute(), |
134 settings.Route.ANDROID_APPS); | 134 settings.routes.ANDROID_APPS); |
135 }); | 135 }); |
136 }); | 136 }); |
137 }); | 137 }); |
138 | 138 |
139 suite('Enforced', function() { | 139 suite('Enforced', function() { |
140 var subpage; | 140 var subpage; |
141 | 141 |
142 setup(function() { | 142 setup(function() { |
143 androidAppsPage.havePlayStoreApp = true; | 143 androidAppsPage.havePlayStoreApp = true; |
144 androidAppsPage.prefs = { | 144 androidAppsPage.prefs = { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 var promise = androidAppsBrowserProxy.whenCalled( | 185 var promise = androidAppsBrowserProxy.whenCalled( |
186 'showAndroidAppsSettings'); | 186 'showAndroidAppsSettings'); |
187 // MockInteractions.tap does not work here due style is not updated. | 187 // MockInteractions.tap does not work here due style is not updated. |
188 button.click(); | 188 button.click(); |
189 Polymer.dom.flush(); | 189 Polymer.dom.flush(); |
190 return promise; | 190 return promise; |
191 }); | 191 }); |
192 }); | 192 }); |
193 | 193 |
194 }); | 194 }); |
OLD | NEW |