Disable TabDragController tests that fail with a real compositor.
[chromium-blink-merge.git] / chrome / browser / ui / webui / app_list / start_page_browsertest.js
blob1fa27db4d424e5e8f8812475a00f86437a32919f
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 /**
6 * TestFixture for kiosk app settings WebUI testing.
7 * @extends {testing.Test}
8 * @constructor
9 **/
10 function AppListStartPageWebUITest() {}
12 AppListStartPageWebUITest.prototype = {
13 __proto__: testing.Test.prototype,
15 /**
16 * Browser to app launcher start page.
18 browsePreload: 'chrome://app-list/',
20 /**
21 * Recommend apps data.
22 * @private
24 recommendedApps_: [
26 'appId': 'app_id_1',
27 'textTitle': 'app 1',
28 'iconUrl': 'icon_url_1'
31 'appId': 'app_id_2',
32 'textTitle': 'app 2',
33 'iconUrl': 'icon_url_2'
37 /** @override */
38 preLoad: function() {
39 this.makeAndRegisterMockHandler(['initialize', 'launchApp']);
40 this.mockHandler.stubs().initialize().will(callFunction(function() {
41 appList.startPage.setRecommendedApps(this.recommendedApps_);
42 }.bind(this)));
43 this.mockHandler.stubs().launchApp(ANYTHING);
47 TEST_F('AppListStartPageWebUITest', 'Basic', function() {
48 assertEquals(this.browsePreload, document.location.href);
50 var recommendedApp = $('start-page').querySelector('.recommended-apps');
51 assertEquals(this.recommendedApps_.length, recommendedApp.childElementCount);
52 for (var i = 0; i < recommendedApp.childElementCount; ++i) {
53 assertEquals(this.recommendedApps_[i].appId,
54 recommendedApp.children[i].appId);
56 });
58 TEST_F('AppListStartPageWebUITest', 'ClickToLaunch', function() {
59 var recommendedApp = $('start-page').querySelector('.recommended-apps');
60 for (var i = 0; i < recommendedApp.childElementCount; ++i) {
61 this.mockHandler.expects(once()).launchApp(
62 [this.recommendedApps_[i].appId]);
63 cr.dispatchSimpleEvent(recommendedApp.children[i], 'click');
65 });