| Index: chrome/test/data/webui/settings/zoom_levels_tests.js
|
| diff --git a/chrome/test/data/webui/settings/zoom_levels_tests.js b/chrome/test/data/webui/settings/zoom_levels_tests.js
|
| index 3ac5a41726cdc16f47c16eaf093a85615ccb3f3d..c3e5aa5be81ac499e6de2694547e81945ac6b487 100644
|
| --- a/chrome/test/data/webui/settings/zoom_levels_tests.js
|
| +++ b/chrome/test/data/webui/settings/zoom_levels_tests.js
|
| @@ -3,87 +3,86 @@
|
| // found in the LICENSE file.
|
|
|
| /** @fileoverview Suite of tests for zoom-levels. */
|
| -cr.define('zoom_levels', function() {
|
| - function registerTests() {
|
| - suite('ZoomLevels', function() {
|
| - /**
|
| - * A zoom levels category created before each test.
|
| - * @type {ZoomLevels}
|
| - */
|
| - var testElement;
|
| +suite('ZoomLevels', function() {
|
| + /**
|
| + * A zoom levels category created before each test.
|
| + * @type {ZoomLevels}
|
| + */
|
| + var testElement;
|
|
|
| - /**
|
| - * The mock proxy object to use during test.
|
| - * @type {TestSiteSettingsPrefsBrowserProxy}
|
| - */
|
| - var browserProxy = null;
|
| + /**
|
| + * The mock proxy object to use during test.
|
| + * @type {TestSiteSettingsPrefsBrowserProxy}
|
| + */
|
| + var browserProxy = null;
|
|
|
| - /**
|
| - * An example zoom list.
|
| - * @type {!Array<ZoomLevelEntry>}
|
| - */
|
| - var zoomList = [
|
| - {
|
| - origin: 'http://www.google.com',
|
| - displayName: 'http://www.google.com',
|
| - originForFavicon: 'http://www.google.com',
|
| - setting: '',
|
| - source: '',
|
| - zoom: '125%',
|
| - },
|
| - {
|
| - origin: 'http://www.chromium.org',
|
| - displayName: 'http://www.chromium.org',
|
| - originForFavicon: 'http://www.chromium.org',
|
| - setting: '',
|
| - source: '',
|
| - zoom: '125%',
|
| - },
|
| - ];
|
| + /**
|
| + * An example zoom list.
|
| + * @type {!Array<ZoomLevelEntry>}
|
| + */
|
| + var zoomList = [
|
| + {
|
| + origin: 'http://www.google.com',
|
| + displayName: 'http://www.google.com',
|
| + originForFavicon: 'http://www.google.com',
|
| + setting: '',
|
| + source: '',
|
| + zoom: '125%',
|
| + },
|
| + {
|
| + origin: 'http://www.chromium.org',
|
| + displayName: 'http://www.chromium.org',
|
| + originForFavicon: 'http://www.chromium.org',
|
| + setting: '',
|
| + source: '',
|
| + zoom: '125%',
|
| + },
|
| + ];
|
|
|
| - setup(function() {
|
| - browserProxy = new TestSiteSettingsPrefsBrowserProxy();
|
| - settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = browserProxy;
|
| - return initPage();
|
| - });
|
| + setup(function() {
|
| + browserProxy = new TestSiteSettingsPrefsBrowserProxy();
|
| + settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = browserProxy;
|
| + return initPage();
|
| + });
|
|
|
| - teardown(function() {
|
| - testElement.remove();
|
| - testElement = null;
|
| - });
|
| + teardown(function() {
|
| + testElement.remove();
|
| + testElement = null;
|
| + });
|
|
|
| - /** @return {!Promise} */
|
| - function initPage() {
|
| - browserProxy.reset();
|
| - PolymerTest.clearBody();
|
| - testElement = document.createElement('zoom-levels');
|
| - document.body.appendChild(testElement);
|
| - return browserProxy.whenCalled('fetchZoomLevels');
|
| - }
|
| + /** @return {!Promise} */
|
| + function initPage() {
|
| + browserProxy.reset();
|
| + PolymerTest.clearBody();
|
| + testElement = document.createElement('zoom-levels');
|
| + document.body.appendChild(testElement);
|
| + return browserProxy.whenCalled('fetchZoomLevels');
|
| + }
|
|
|
| - /**
|
| - * Fetch the remove button from the list.
|
| - * @param {!HTMLElement} listContainer The list to use for the lookup.
|
| - * @param {number} index The index of the child element (which site) to
|
| - * fetch.
|
| - */
|
| - function getRemoveButton(listContainer, index) {
|
| - return listContainer.children[index].querySelector('paper-icon-button');
|
| - }
|
| + /**
|
| + * Fetch the remove button from the list.
|
| + * @param {!HTMLElement} listContainer The list to use for the lookup.
|
| + * @param {number} index The index of the child element (which site) to
|
| + * fetch.
|
| + */
|
| + function getRemoveButton(listContainer, index) {
|
| + return listContainer.children[index].querySelector('paper-icon-button');
|
| + }
|
|
|
| - test('empty zoom state', function() {
|
| - var list = testElement.$.list;
|
| - assertTrue(!!list);
|
| - assertEquals(0, list.items.length);
|
| - assertEquals(
|
| - 0, testElement.shadowRoot.querySelectorAll('.list-item').length);
|
| - assertTrue(!!testElement.$$('#empty'));
|
| - });
|
| + test('empty zoom state', function() {
|
| + var list = testElement.$.list;
|
| + assertTrue(!!list);
|
| + assertEquals(0, list.items.length);
|
| + assertEquals(
|
| + 0, testElement.shadowRoot.querySelectorAll('.list-item').length);
|
| + assertTrue(!!testElement.$$('#empty'));
|
| + });
|
|
|
| - test('non-empty zoom state', function() {
|
| - browserProxy.setZoomList(zoomList);
|
| + test('non-empty zoom state', function() {
|
| + browserProxy.setZoomList(zoomList);
|
|
|
| - return initPage().then(function() {
|
| + return initPage()
|
| + .then(function() {
|
| var list = testElement.$.list;
|
| assertTrue(!!list);
|
| assertEquals(2, list.items.length);
|
| @@ -91,19 +90,13 @@ cr.define('zoom_levels', function() {
|
| assertEquals(
|
| 2, testElement.shadowRoot.querySelectorAll('.list-item').length);
|
|
|
| - var removeButton =
|
| - getRemoveButton(testElement.$.listContainer, 0);
|
| + var removeButton = getRemoveButton(testElement.$.listContainer, 0);
|
| assert(!!removeButton);
|
| MockInteractions.tap(removeButton);
|
| return browserProxy.whenCalled('removeZoomLevel');
|
| - }).then(function(args) {
|
| - assertEquals("http://www.google.com", args[0]);
|
| + })
|
| + .then(function(args) {
|
| + assertEquals('http://www.google.com', args[0]);
|
| });
|
| - });
|
| - });
|
| - }
|
| -
|
| - return {
|
| - registerTests: registerTests,
|
| - };
|
| + });
|
| });
|
|
|