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

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

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 2 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
11 */ 11 */
12 function NTP4WebUITest() {} 12 function NTP4WebUITest() {}
13 13
14 NTP4WebUITest.prototype = { 14 NTP4WebUITest.prototype = {
15 __proto__: testing.Test.prototype, 15 __proto__: testing.Test.prototype,
16 16
17 /** @override */ 17 /** @override */
18 browsePreload: 'chrome://newtab', 18 browsePreload: 'chrome://newtab',
19 }; 19 };
20 20
21 // Test loading new tab page and selecting each card doesn't have console 21 // Test loading new tab page and selecting each card doesn't have console
22 // errors. 22 // errors.
23 TEST_F('NTP4WebUITest', 'TestBrowsePages', function() { 23 // TODO(samarth): remove along with NTP4 code.
24 TEST_F('NTP4WebUITest', 'DISABLED_TestBrowsePages', function() {
24 // This tests the ntp4 new tab page which is not used on touch builds. 25 // This tests the ntp4 new tab page which is not used on touch builds.
25 var cardSlider = ntp.getCardSlider(); 26 var cardSlider = ntp.getCardSlider();
26 assertNotEquals(null, cardSlider); 27 assertNotEquals(null, cardSlider);
27 for (var i = 0; i < cardSlider.cardCount; i++) { 28 for (var i = 0; i < cardSlider.cardCount; i++) {
28 cardSlider.selectCard(i); 29 cardSlider.selectCard(i);
29 expectEquals(i, cardSlider.currentCard); 30 expectEquals(i, cardSlider.currentCard);
30 } 31 }
31 }); 32 });
32 33
33 // http://crbug.com/118944 34 // http://crbug.com/118944
34 TEST_F('NTP4WebUITest', 'DISABLED_NTPHasThumbnails', function() { 35 TEST_F('NTP4WebUITest', 'DISABLED_NTPHasThumbnails', function() {
35 var mostVisited = document.querySelectorAll('.most-visited'); 36 var mostVisited = document.querySelectorAll('.most-visited');
36 assertEquals(8, mostVisited.length, 'There should be 8 most visited tiles.'); 37 assertEquals(8, mostVisited.length, 'There should be 8 most visited tiles.');
37 38
38 var apps = document.querySelectorAll('.app'); 39 var apps = document.querySelectorAll('.app');
39 if (loadTimeData.getBoolean('showApps')) 40 if (loadTimeData.getBoolean('showApps'))
40 assertGE(apps.length, 1, 'There should be at least one app.'); 41 assertGE(apps.length, 1, 'There should be at least one app.');
41 else 42 else
42 assertEquals(0, apps.length, 'There should be no apps.'); 43 assertEquals(0, apps.length, 'There should be no apps.');
43 }); 44 });
44 45
45 TEST_F('NTP4WebUITest', 'NTPHasNavDots', function() { 46 // TODO(samarth): remove along with NTP4 code.
47 TEST_F('NTP4WebUITest', 'DISABLED_NTPHasNavDots', function() {
46 var navDots = document.querySelectorAll('.dot'); 48 var navDots = document.querySelectorAll('.dot');
47 if (loadTimeData.getBoolean('showApps')) 49 if (loadTimeData.getBoolean('showApps'))
48 assertGE(navDots.length, 2, 'There should be at least two navdots.'); 50 assertGE(navDots.length, 2, 'There should be at least two navdots.');
49 else 51 else
50 assertEquals(1, navDots.length, 'There should be exactly one navdot.'); 52 assertEquals(1, navDots.length, 'There should be exactly one navdot.');
51 }); 53 });
52 54
53 // http://crbug.com/118514 55 // http://crbug.com/118514
54 TEST_F('NTP4WebUITest', 'DISABLED_NTPHasSelectedPageAndDot', function() { 56 TEST_F('NTP4WebUITest', 'DISABLED_NTPHasSelectedPageAndDot', function() {
55 var selectedDot = document.querySelectorAll('.dot.selected'); 57 var selectedDot = document.querySelectorAll('.dot.selected');
56 assertEquals(1, selectedDot.length, 58 assertEquals(1, selectedDot.length,
57 'There should be exactly one selected dot.'); 59 'There should be exactly one selected dot.');
58 60
59 var selectedTilePage = document.querySelectorAll('.tile-page.selected-card'); 61 var selectedTilePage = document.querySelectorAll('.tile-page.selected-card');
60 assertEquals(1, selectedTilePage.length, 62 assertEquals(1, selectedTilePage.length,
61 'There should be exactly one selected tile page.'); 63 'There should be exactly one selected tile page.');
62 }); 64 });
63 65
64 TEST_F('NTP4WebUITest', 'NTPHasNoLoginNameWhenSignedOut', function() { 66 // TODO(samarth): remove along with NTP4 code.
67 TEST_F('NTP4WebUITest', 'DISABLED_NTPHasNoLoginNameWhenSignedOut', function() {
65 var userName = document.querySelector('#login-status-header .profile-name'); 68 var userName = document.querySelector('#login-status-header .profile-name');
66 assertEquals(null, userName, 'Login name shouldn\'t exist when signed out.'); 69 assertEquals(null, userName, 'Login name shouldn\'t exist when signed out.');
67 }); 70 });
68 71
69 /** 72 /**
70 * Test fixture for NTP4 WebUI testing with login. 73 * Test fixture for NTP4 WebUI testing with login.
71 * @extends {NTP4WebUITest} 74 * @extends {NTP4WebUITest}
72 * @constructor 75 * @constructor
73 */ 76 */
74 function NTP4LoggedInWebUITest() {} 77 function NTP4LoggedInWebUITest() {}
75 78
76 NTP4LoggedInWebUITest.prototype = { 79 NTP4LoggedInWebUITest.prototype = {
77 __proto__: NTP4WebUITest.prototype, 80 __proto__: NTP4WebUITest.prototype,
78 81
79 /** @override */ 82 /** @override */
80 typedefCppFixture: 'NTP4LoggedInWebUITest', 83 typedefCppFixture: 'NTP4LoggedInWebUITest',
81 84
82 /** @override */ 85 /** @override */
83 testGenPreamble: function() { 86 testGenPreamble: function() {
84 GEN(' SetLoginName("user@gmail.com");'); 87 GEN(' SetLoginName("user@gmail.com");');
85 }, 88 },
86 }; 89 };
87 90
88 // The following test is irrelevant to Chrome on Chrome OS. 91 // The following test is irrelevant to Chrome on Chrome OS.
89 GEN('#if !defined(OS_CHROMEOS)'); 92 GEN('#if !defined(OS_CHROMEOS)');
90 93
91 TEST_F('NTP4LoggedInWebUITest', 'NTPHasLoginNameWhenSignedIn', function() { 94 // TODO(samarth): delete along with rest of NTP4 code.
95 TEST_F('NTP4LoggedInWebUITest', 'DISABLED_NTPHasLoginNameWhenSignedIn',
96 function() {
92 var userName = document.querySelector('#login-status-header .profile-name'); 97 var userName = document.querySelector('#login-status-header .profile-name');
93 assertNotEquals(userName, null, 'The logged-in user name can\'t be found.'); 98 assertNotEquals(userName, null, 'The logged-in user name can\'t be found.');
94 assertEquals('user@gmail.com', userName.textContent, 99 assertEquals('user@gmail.com', userName.textContent,
95 'The user name should be present on the new tab.'); 100 'The user name should be present on the new tab.');
96 }); 101 });
97 102
98 GEN('#endif'); 103 GEN('#endif');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698