| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "extensions/browser/api/system_display/display_info_provider.h" | 5 #include "extensions/browser/api/system_display/display_info_provider.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "ash/display/screen_orientation_controller_chromeos.h" | 9 #include "ash/display/screen_orientation_controller_chromeos.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 EXPECT_EQ("0,0,0,0", SystemInfoDisplayInsetsToString(result[1].overscan)); | 349 EXPECT_EQ("0,0,0,0", SystemInfoDisplayInsetsToString(result[1].overscan)); |
| 350 EXPECT_EQ(0, result[1].rotation); | 350 EXPECT_EQ(0, result[1].rotation); |
| 351 EXPECT_FALSE(result[1].is_primary); | 351 EXPECT_FALSE(result[1].is_primary); |
| 352 EXPECT_FALSE(result[1].is_unified); | 352 EXPECT_FALSE(result[1].is_unified); |
| 353 EXPECT_EQ(96, result[1].dpi_x); | 353 EXPECT_EQ(96, result[1].dpi_x); |
| 354 EXPECT_EQ(96, result[1].dpi_y); | 354 EXPECT_EQ(96, result[1].dpi_y); |
| 355 EXPECT_TRUE(result[1].mirroring_source_id.empty()); | 355 EXPECT_TRUE(result[1].mirroring_source_id.empty()); |
| 356 EXPECT_TRUE(result[1].is_enabled); | 356 EXPECT_TRUE(result[1].is_enabled); |
| 357 } | 357 } |
| 358 | 358 |
| 359 TEST_F(DisplayInfoProviderChromeosTest, GetMaximizeMode) { |
| 360 UpdateDisplay("500x600,400x520"); |
| 361 |
| 362 // Check initial state. |
| 363 DisplayUnitInfoList result = GetAllDisplaysInfo(); |
| 364 ASSERT_EQ(2u, result.size()); |
| 365 EXPECT_TRUE(result[0].is_primary); |
| 366 EXPECT_FALSE(result[0].is_maximize_mode); |
| 367 EXPECT_FALSE(result[1].is_primary); |
| 368 EXPECT_FALSE(result[1].is_maximize_mode); |
| 369 |
| 370 EnableMaximizeMode(true); |
| 371 result = GetAllDisplaysInfo(); |
| 372 ASSERT_EQ(2u, result.size()); |
| 373 EXPECT_TRUE(result[0].is_primary); |
| 374 EXPECT_TRUE(result[0].is_maximize_mode); |
| 375 EXPECT_FALSE(result[1].is_primary); |
| 376 EXPECT_FALSE(result[1].is_maximize_mode); |
| 377 } |
| 378 |
| 359 TEST_F(DisplayInfoProviderChromeosTest, GetRotation) { | 379 TEST_F(DisplayInfoProviderChromeosTest, GetRotation) { |
| 360 UpdateDisplay("500x600/r"); | 380 UpdateDisplay("500x600/r"); |
| 361 DisplayUnitInfoList result = GetAllDisplaysInfo(); | 381 DisplayUnitInfoList result = GetAllDisplaysInfo(); |
| 362 | 382 |
| 363 ASSERT_EQ(1u, result.size()); | 383 ASSERT_EQ(1u, result.size()); |
| 364 | 384 |
| 365 int64_t display_id; | 385 int64_t display_id; |
| 366 ASSERT_TRUE(base::StringToInt64(result[0].id, &display_id)) | 386 ASSERT_TRUE(base::StringToInt64(result[0].id, &display_id)) |
| 367 << "Display id must be convertable to integer: " << result[0].id; | 387 << "Display id must be convertable to integer: " << result[0].id; |
| 368 | 388 |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1559 EXPECT_EQ(pairs.pair1.touch_point.y, data.point_pairs[0].second.y()); | 1579 EXPECT_EQ(pairs.pair1.touch_point.y, data.point_pairs[0].second.y()); |
| 1560 EXPECT_EQ(pairs.pair2.touch_point.y, data.point_pairs[1].second.y()); | 1580 EXPECT_EQ(pairs.pair2.touch_point.y, data.point_pairs[1].second.y()); |
| 1561 EXPECT_EQ(pairs.pair3.touch_point.y, data.point_pairs[2].second.y()); | 1581 EXPECT_EQ(pairs.pair3.touch_point.y, data.point_pairs[2].second.y()); |
| 1562 EXPECT_EQ(pairs.pair4.touch_point.y, data.point_pairs[3].second.y()); | 1582 EXPECT_EQ(pairs.pair4.touch_point.y, data.point_pairs[3].second.y()); |
| 1563 | 1583 |
| 1564 EXPECT_EQ(bounds.width, data.bounds.width()); | 1584 EXPECT_EQ(bounds.width, data.bounds.width()); |
| 1565 EXPECT_EQ(bounds.height, data.bounds.height()); | 1585 EXPECT_EQ(bounds.height, data.bounds.height()); |
| 1566 } | 1586 } |
| 1567 } // namespace | 1587 } // namespace |
| 1568 } // namespace extensions | 1588 } // namespace extensions |
| OLD | NEW |