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

Side by Side Diff: chrome/test/data/extensions/api_test/systeminfo/display/test_display_api.js

Issue 16687002: Add additional properties to display system info on ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review feedback; win compile fix Created 7 years, 6 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 // systeminfo.memory api test 5 // systeminfo.memory api test
6 // browser_tests --gtest_filter=SystemInfoMemoryApiTest.* 6 // browser_tests --gtest_filter=SystemInfoMemoryApiTest.*
7 7
8 chrome.test.runTests([ 8 chrome.test.runTests([
9 function testGet() { 9 function testGet() {
10 for(var i = 0; i < 10; ++i) { 10 for(var i = 0; i < 10; ++i) {
11 chrome.systemInfo.display.getDisplayInfo( 11 chrome.systemInfo.display.getDisplayInfo(
12 chrome.test.callbackPass(function(result) { 12 chrome.test.callbackPass(function(result) {
13 chrome.test.assertEq(2, result.length); 13 chrome.test.assertEq(4, result.length);
14 for (var i = 0; i < result.length; i++) { 14 for (var i = 0; i < result.length; i++) {
15 var info = result[i]; 15 var info = result[i];
16 chrome.test.assertEq('DISPLAY', info.id); 16 chrome.test.assertEq('' + i, info.id);
17 chrome.test.assertEq('DISPLAY NAME', info.name); 17 chrome.test.assertEq('DISPLAY NAME FOR ' + i, info.name);
18 chrome.test.assertEq(i == 0 ? true : false, info.isPrimary); 18 chrome.test.assertEq(i == 0 ? true : false, info.isPrimary);
19 chrome.test.assertEq(i == 0 ? true : false, info.isInternal); 19 chrome.test.assertEq(i == 0 ? true : false, info.isInternal);
20 if (i == 1) {
21 chrome.test.assertEq('0', info.mirroringSourceId);
22 } else {
23 chrome.test.assertEq('', info.mirroringSourceId);
24 }
20 chrome.test.assertEq(true, info.isEnabled); 25 chrome.test.assertEq(true, info.isEnabled);
26 chrome.test.assertEq(90 * i, info.rotation);
21 chrome.test.assertEq(96.0, info.dpiX); 27 chrome.test.assertEq(96.0, info.dpiX);
22 chrome.test.assertEq(96.0, info.dpiY); 28 chrome.test.assertEq(96.0, info.dpiY);
23 chrome.test.assertEq(0, info.bounds.left); 29 chrome.test.assertEq(0, info.bounds.left);
24 chrome.test.assertEq(0, info.bounds.top); 30 chrome.test.assertEq(0, info.bounds.top);
25 chrome.test.assertEq(1280, info.bounds.width); 31 chrome.test.assertEq(1280, info.bounds.width);
26 chrome.test.assertEq(720, info.bounds.height); 32 chrome.test.assertEq(720, info.bounds.height);
33 if (i == 0) {
34 chrome.test.assertEq(20, info.visibleArea.left);
35 chrome.test.assertEq(40, info.visibleArea.top);
36 chrome.test.assertEq(1280, info.visibleArea.width);
37 chrome.test.assertEq(720, info.visibleArea.height);
38 } else {
39 chrome.test.assertEq(0, info.visibleArea.left);
40 chrome.test.assertEq(0, info.visibleArea.top);
41 chrome.test.assertEq(0, info.visibleArea.width);
42 chrome.test.assertEq(0, info.visibleArea.height);
43 }
27 chrome.test.assertEq(0, info.workArea.left); 44 chrome.test.assertEq(0, info.workArea.left);
28 chrome.test.assertEq(0, info.workArea.top); 45 chrome.test.assertEq(0, info.workArea.top);
29 chrome.test.assertEq(960, info.workArea.width); 46 chrome.test.assertEq(960, info.workArea.width);
30 chrome.test.assertEq(720, info.workArea.height); 47 chrome.test.assertEq(720, info.workArea.height);
31 } 48 }
32 })); 49 }));
33 } 50 }
34 } 51 }
35 ]); 52 ]);
36 53
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698