| 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 29 matching lines...) Expand all Loading... |
| 119 var remove = subpage.$$('#remove'); | 119 var remove = subpage.$$('#remove'); |
| 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( |
| 130 settings.Route.ANDROID_APPS_DETAILS); | 130 settings.getCurrentRoute(), 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(), settings.routes.ANDROID_APPS); |
| 134 settings.Route.ANDROID_APPS); | |
| 135 }); | 134 }); |
| 136 }); | 135 }); |
| 137 }); | 136 }); |
| 138 | 137 |
| 139 suite('Enforced', function() { | 138 suite('Enforced', function() { |
| 140 var subpage; | 139 var subpage; |
| 141 | 140 |
| 142 setup(function() { | 141 setup(function() { |
| 143 androidAppsPage.havePlayStoreApp = true; | 142 androidAppsPage.havePlayStoreApp = true; |
| 144 androidAppsPage.prefs = { | 143 androidAppsPage.prefs = { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 var promise = androidAppsBrowserProxy.whenCalled( | 184 var promise = androidAppsBrowserProxy.whenCalled( |
| 186 'showAndroidAppsSettings'); | 185 'showAndroidAppsSettings'); |
| 187 // MockInteractions.tap does not work here due style is not updated. | 186 // MockInteractions.tap does not work here due style is not updated. |
| 188 button.click(); | 187 button.click(); |
| 189 Polymer.dom.flush(); | 188 Polymer.dom.flush(); |
| 190 return promise; | 189 return promise; |
| 191 }); | 190 }); |
| 192 }); | 191 }); |
| 193 | 192 |
| 194 }); | 193 }); |
| OLD | NEW |