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

Side by Side Diff: chrome/test/data/webui/ntp4.js

Issue 10141005: switch ntp to jstemplate v2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update test Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 GEN('#include "chrome/test/data/webui/ntp4_browsertest.h"'); 5 GEN('#include "chrome/test/data/webui/ntp4_browsertest.h"');
6 6
7 /** 7 /**
8 * TestFixture for NTP4 WebUI testing. 8 * TestFixture for NTP4 WebUI testing.
9 * @extends {testing.Test} 9 * @extends {testing.Test}
10 * @constructor 10 * @constructor
(...skipping 18 matching lines...) Expand all
29 expectEquals(i, cardSlider.currentCard); 29 expectEquals(i, cardSlider.currentCard);
30 } 30 }
31 }); 31 });
32 32
33 // http://crbug.com/118944 33 // http://crbug.com/118944
34 TEST_F('NTP4WebUITest', 'FLAKY_NTPHasThumbnails', function() { 34 TEST_F('NTP4WebUITest', 'FLAKY_NTPHasThumbnails', function() {
35 var mostVisited = document.querySelectorAll('.most-visited'); 35 var mostVisited = document.querySelectorAll('.most-visited');
36 assertEquals(8, mostVisited.length, 'There should be 8 most visited tiles.'); 36 assertEquals(8, mostVisited.length, 'There should be 8 most visited tiles.');
37 37
38 var apps = document.querySelectorAll('.app'); 38 var apps = document.querySelectorAll('.app');
39 if (window.templateData.showApps) 39 if (window.loadTimeData['showApps'])
Dan Beam 2012/04/25 23:13:12 er, what? shouldn't this be loadTimeData.getBoolea
Evan Stade 2012/04/26 00:44:56 correct question is why am I not using getBoolean.
40 assertGE(apps.length, 1, 'There should be at least one app.'); 40 assertGE(apps.length, 1, 'There should be at least one app.');
41 else 41 else
42 assertEquals(0, apps.length, 'There should be no apps.'); 42 assertEquals(0, apps.length, 'There should be no apps.');
43 }); 43 });
44 44
45 TEST_F('NTP4WebUITest', 'NTPHasNavDots', function() { 45 TEST_F('NTP4WebUITest', 'NTPHasNavDots', function() {
46 var navDots = document.querySelectorAll('.dot'); 46 var navDots = document.querySelectorAll('.dot');
47 if (window.templateData.showApps) 47 if (window.loadtimeData['showApps'])
48 assertGE(navDots.length, 2, 'There should be at least two navdots.'); 48 assertGE(navDots.length, 2, 'There should be at least two navdots.');
49 else 49 else
50 assertEquals(1, navDots.length, 'There should be exactly one navdot.'); 50 assertEquals(1, navDots.length, 'There should be exactly one navdot.');
51 }); 51 });
52 52
53 // http://crbug.com/118514 53 // http://crbug.com/118514
54 TEST_F('NTP4WebUITest', 'FLAKY_NTPHasSelectedPageAndDot', function() { 54 TEST_F('NTP4WebUITest', 'FLAKY_NTPHasSelectedPageAndDot', function() {
55 var selectedDot = document.querySelectorAll('.dot.selected'); 55 var selectedDot = document.querySelectorAll('.dot.selected');
56 assertEquals(1, selectedDot.length, 56 assertEquals(1, selectedDot.length,
57 'There should be exactly one selected dot.'); 57 'There should be exactly one selected dot.');
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 GEN('#if !defined(OS_CHROMEOS)'); 89 GEN('#if !defined(OS_CHROMEOS)');
90 90
91 TEST_F('NTP4LoggedInWebUITest', 'NTPHasLoginNameWhenSignedIn', function() { 91 TEST_F('NTP4LoggedInWebUITest', 'NTPHasLoginNameWhenSignedIn', function() {
92 var userName = document.querySelector('#login-status-header .profile-name'); 92 var userName = document.querySelector('#login-status-header .profile-name');
93 assertNotEquals(userName, null, 'The logged-in user name can\'t be found.'); 93 assertNotEquals(userName, null, 'The logged-in user name can\'t be found.');
94 assertEquals('user@gmail.com', userName.textContent, 94 assertEquals('user@gmail.com', userName.textContent,
95 'The user name should be present on the new tab.'); 95 'The user name should be present on the new tab.');
96 }); 96 });
97 97
98 GEN('#endif'); 98 GEN('#endif');
OLDNEW
« chrome/common/jstemplate_builder.h ('K') | « chrome/common/jstemplate_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698