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

Side by Side Diff: ui/file_manager/file_manager/background/js/test_util_base.js

Issue 1608143002: support animated GIF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add assert to pass closure compiler Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/file_manager/gallery/css/gallery.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 /** 5 /**
6 * Namespace for test related things. 6 * Namespace for test related things.
7 */ 7 */
8 var test = test || {}; 8 var test = test || {};
9 9
10 /** 10 /**
(...skipping 13 matching lines...) Expand all
24 attributes[element.attributes[i].nodeName] = 24 attributes[element.attributes[i].nodeName] =
25 element.attributes[i].nodeValue; 25 element.attributes[i].nodeValue;
26 } 26 }
27 var styles = {}; 27 var styles = {};
28 var styleNames = opt_styleNames || []; 28 var styleNames = opt_styleNames || [];
29 var computedStyles = contentWindow.getComputedStyle(element); 29 var computedStyles = contentWindow.getComputedStyle(element);
30 for (var i = 0; i < styleNames.length; i++) { 30 for (var i = 0; i < styleNames.length; i++) {
31 styles[styleNames[i]] = computedStyles[styleNames[i]]; 31 styles[styleNames[i]] = computedStyles[styleNames[i]];
32 } 32 }
33 var text = element.textContent; 33 var text = element.textContent;
34 var size = element.getBoundingClientRect();
34 return { 35 return {
35 attributes: attributes, 36 attributes: attributes,
36 text: text, 37 text: text,
37 value: element.value, 38 value: element.value,
38 styles: styles, 39 styles: styles,
39 // The hidden attribute is not in the element.attributes even if 40 // The hidden attribute is not in the element.attributes even if
40 // element.hasAttribute('hidden') is true. 41 // element.hasAttribute('hidden') is true.
41 hidden: !!element.hidden 42 hidden: !!element.hidden,
43 // These attributes are set when element is img or canvas.
44 imageWidth: Number(element.width),
45 imageHeight: Number(element.height),
46 // These attributes are set in any element.
47 renderedWidth: size.width,
48 renderedHeight: size.height
42 }; 49 };
43 } 50 }
44 51
45 /** 52 /**
46 * Namespace for test utility functions. 53 * Namespace for test utility functions.
47 * 54 *
48 * Public functions in the test.util.sync and the test.util.async namespaces are 55 * Public functions in the test.util.sync and the test.util.async namespaces are
49 * published to test cases and can be called by using callRemoteTestUtil. The 56 * published to test cases and can be called by using callRemoteTestUtil. The
50 * arguments are serialized as JSON internally. If application ID is passed to 57 * arguments are serialized as JSON internally. If application ID is passed to
51 * callRemoteTestUtil, the content window of the application is added as the 58 * callRemoteTestUtil, the content window of the application is added as the
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 return true; 577 return true;
571 } else if (test.util.sync[request.func]) { 578 } else if (test.util.sync[request.func]) {
572 sendResponse(test.util.sync[request.func].apply(null, args)); 579 sendResponse(test.util.sync[request.func].apply(null, args));
573 return false; 580 return false;
574 } else { 581 } else {
575 console.error('Invalid function name.'); 582 console.error('Invalid function name.');
576 return false; 583 return false;
577 } 584 }
578 }); 585 });
579 }; 586 };
OLDNEW
« no previous file with comments | « no previous file | ui/file_manager/gallery/css/gallery.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698