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

Side by Side Diff: chrome/test/data/pdf/material_elements_test.js

Issue 1985573002: PDF: Use custom iconsets instead of iron-icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/settings/icons.html ('k') | ui/webui/resources/cr_elements/icons.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** 5 /**
6 * Standalone unit tests of the PDF Polymer elements. 6 * Standalone unit tests of the PDF Polymer elements.
7 */ 7 */
8 var tests = [ 8 var tests = [
9 /** 9 /**
10 * Test that viewer-page-selector reacts correctly to text entry. The page 10 * Test that viewer-page-selector reacts correctly to text entry. The page
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 lastEvent = e.type; 153 lastEvent = e.type;
154 } 154 }
155 var assertEvent = function(type) { 155 var assertEvent = function(type) {
156 chrome.test.assertEq(type, lastEvent); 156 chrome.test.assertEq(type, lastEvent);
157 lastEvent = null; 157 lastEvent = null;
158 } 158 }
159 zoomToolbar.addEventListener('fit-to-width', logEvent); 159 zoomToolbar.addEventListener('fit-to-width', logEvent);
160 zoomToolbar.addEventListener('fit-to-page', logEvent); 160 zoomToolbar.addEventListener('fit-to-page', logEvent);
161 161
162 // Initial: Show fit-to-page. 162 // Initial: Show fit-to-page.
163 chrome.test.assertEq(fitPageIcon, fab.icon); 163 // TODO(tsergeant): This assertion attempts to be resilient to iconset
164 // changes. A better solution is something like
165 // https://github.com/PolymerElements/iron-icon/issues/68.
166 chrome.test.assertTrue(fab.icon.endsWith(fitPageIcon));
164 167
165 // Tap 1: Fire fit-to-page, show fit-to-width. 168 // Tap 1: Fire fit-to-page, show fit-to-width.
166 MockInteractions.tap(fab); 169 MockInteractions.tap(fab);
167 assertEvent('fit-to-page'); 170 assertEvent('fit-to-page');
168 chrome.test.assertEq(fitWidthIcon, fab.icon); 171 chrome.test.assertTrue(fab.icon.endsWith(fitWidthIcon));
169 172
170 // Tap 2: Fire fit-to-width, show fit-to-page. 173 // Tap 2: Fire fit-to-width, show fit-to-page.
171 MockInteractions.tap(fab); 174 MockInteractions.tap(fab);
172 assertEvent('fit-to-width'); 175 assertEvent('fit-to-width');
173 chrome.test.assertEq(fitPageIcon, fab.icon); 176 chrome.test.assertTrue(fab.icon.endsWith(fitPageIcon));
174 177
175 // Tap 3: Fire fit-to-page again. 178 // Tap 3: Fire fit-to-page again.
176 MockInteractions.tap(fab); 179 MockInteractions.tap(fab);
177 assertEvent('fit-to-page'); 180 assertEvent('fit-to-page');
178 181
179 chrome.test.succeed(); 182 chrome.test.succeed();
180 } 183 }
181 ]; 184 ];
182 185
183 importTestHelpers().then(function() { 186 importTestHelpers().then(function() {
184 chrome.test.runTests(tests); 187 chrome.test.runTests(tests);
185 }); 188 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/icons.html ('k') | ui/webui/resources/cr_elements/icons.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698