OLD | NEW |
| (Empty) |
1 // Copyright (c) 2014 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. | |
4 | |
5 'use strict'; | |
6 | |
7 /** | |
8 * Tests if a thumbnail for the selected item shows up in the preview panel. | |
9 * This thumbnail is fetched via the image loader. | |
10 */ | |
11 testcase.thumbnailsDownloads = function() { | |
12 var appId; | |
13 StepsRunner.run([ | |
14 function() { | |
15 setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next); | |
16 }, | |
17 // Select the image. | |
18 function(inAppId) { | |
19 appId = inAppId; | |
20 callRemoteTestUtil('selectFile', | |
21 appId, | |
22 ['My Desktop Background.png'], | |
23 this.next); | |
24 }, | |
25 // Wait until the thumbnail shows up. | |
26 function(result) { | |
27 chrome.test.assertTrue(result); | |
28 waitForElement(appId, '.preview-thumbnails .img-container img'). | |
29 then(this.next); | |
30 }, | |
31 // Verify the thumbnail. | |
32 function(element) { | |
33 chrome.test.assertTrue(element.attributes.src.indexOf( | |
34 'data:image/jpeg') === 0); | |
35 checkIfNoErrorsOccured(this.next); | |
36 } | |
37 ]); | |
38 }; | |
OLD | NEW |