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

Unified Diff: chrome/browser/ui/webui/app_list/start_page_browsertest.js

Issue 887853003: Make app list start page doodle clickable and have alt text. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@doodle_static
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/app_list/start_page_browsertest.js
diff --git a/chrome/browser/ui/webui/app_list/start_page_browsertest.js b/chrome/browser/ui/webui/app_list/start_page_browsertest.js
index 7a0fd9d193f23fc229cd8157c675a6e8ce69a192..9ccf51babdde02faccab0d84fdf5fc42525e370e 100644
--- a/chrome/browser/ui/webui/app_list/start_page_browsertest.js
+++ b/chrome/browser/ui/webui/app_list/start_page_browsertest.js
@@ -32,17 +32,6 @@ AppListStartPageWebUITest.prototype = {
__proto__: testing.Test.prototype,
/**
- * Sample doodle data.
- */
- doodleData_: {
- 'ddljson': {
- 'transparent_large_image': {
- 'url': 'doodle.png'
- }
- }
- },
-
- /**
* Browser to app launcher start page.
*/
browsePreload: 'chrome://app-list/',
@@ -135,11 +124,40 @@ TEST_F('AppListStartPageWebUITest', 'Basic', function() {
});
TEST_F('AppListStartPageWebUITest', 'LoadDoodle', function() {
- var doodle = $('doodle');
- assertEquals('', doodle.src);
- appList.startPage.onAppListDoodleUpdated(this.doodleData_,
+ var doodleData = {
+ 'ddljson': {
+ 'transparent_large_image': {
+ 'url': 'doodle.png'
+ },
+ 'alt_text': 'Doodle alt text',
+ 'target_url': '/target.html'
+ }
+ };
+
+ assertEquals(null, $('doodle'));
+
+ // Load the doodle with a target url and alt text.
+ appList.startPage.onAppListDoodleUpdated(doodleData,
+ 'http://example.com/');
Matt Giuca 2015/02/03 07:08:50 Can you make this http://example.com/x/. Then you
calamity 2015/02/04 03:16:22 Done.
+ assertNotEquals(null, $('doodle'));
+ assertEquals('http://example.com/doodle.png', $('doodle_image').src);
+ assertEquals(doodleData.ddljson.alt_text, $('doodle_image').title);
+ assertEquals('http://example.com/target.html', $('doodle_link').href);
+
+ // Reload the doodle without a target url and alt text.
+ doodleData.ddljson.alt_text = undefined;
+ doodleData.ddljson.target_url = undefined;
+ appList.startPage.onAppListDoodleUpdated(doodleData,
+ 'http://example.com/');
+ assertNotEquals(null, $('doodle'));
+ assertEquals('http://example.com/doodle.png', $('doodle_image').src);
+ assertEquals('', $('doodle_image').title);
+ assertEquals(null, $('doodle_link'));
+
+
+ appList.startPage.onAppListDoodleUpdated({},
'http://example.com/');
- assertEquals('http://example.com/doodle.png', doodle.src);
+ assertEquals(null, $('doodle'));
});
TEST_F('AppListStartPageWebUITest', 'SpeechRecognitionState', function() {

Powered by Google App Engine
This is Rietveld 408576698