| OLD | NEW |
| 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 #include "chrome/browser/extensions/api/system_info_display/system_info_display_
api.h" | 5 #include "chrome/browser/extensions/api/system_info_display/system_info_display_
api.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "chrome/browser/extensions/api/system_info_display/display_info_provide
r.h" | 8 #include "chrome/browser/extensions/api/system_info_display/display_info_provide
r.h" |
| 9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
| 10 #include "chrome/browser/extensions/extension_function_test_utils.h" | 10 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| 11 | 11 |
| 12 namespace utils = extension_function_test_utils; | 12 namespace utils = extension_function_test_utils; |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 using api::system_info_display::Bounds; | 16 using api::system_info_display::Bounds; |
| 17 using api::system_info_display::DisplayUnitInfo; | 17 using api::system_info_display::DisplayUnitInfo; |
| 18 | 18 |
| 19 class MockDisplayInfoProvider : public DisplayInfoProvider { | 19 class MockDisplayInfoProvider : public DisplayInfoProvider { |
| 20 public: | 20 public: |
| 21 MockDisplayInfoProvider() {} | 21 MockDisplayInfoProvider() {} |
| 22 | 22 |
| 23 virtual bool QueryInfo(DisplayInfo* info) OVERRIDE { | 23 virtual bool QueryInfo() OVERRIDE { |
| 24 DisplayInfo* info = &info_; |
| 24 info->clear(); | 25 info->clear(); |
| 25 for (int i = 0; i < 4; i++) { | 26 for (int i = 0; i < 4; i++) { |
| 26 linked_ptr<DisplayUnitInfo> unit(new DisplayUnitInfo()); | 27 linked_ptr<DisplayUnitInfo> unit(new DisplayUnitInfo()); |
| 27 unit->id = base::IntToString(i); | 28 unit->id = base::IntToString(i); |
| 28 unit->name = "DISPLAY NAME FOR " + unit->id; | 29 unit->name = "DISPLAY NAME FOR " + unit->id; |
| 29 if (i == 1) | 30 if (i == 1) |
| 30 unit->mirroring_source_id = "0"; | 31 unit->mirroring_source_id = "0"; |
| 31 unit->is_primary = i == 0 ? true : false; | 32 unit->is_primary = i == 0 ? true : false; |
| 32 unit->is_internal = i == 0 ? true : false; | 33 unit->is_internal = i == 0 ? true : false; |
| 33 unit->is_enabled = true; | 34 unit->is_enabled = true; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 EXPECT_EQ(1, utils::GetInteger(overscan, "left")); | 204 EXPECT_EQ(1, utils::GetInteger(overscan, "left")); |
| 204 EXPECT_EQ(2, utils::GetInteger(overscan, "top")); | 205 EXPECT_EQ(2, utils::GetInteger(overscan, "top")); |
| 205 EXPECT_EQ(3, utils::GetInteger(overscan, "right")); | 206 EXPECT_EQ(3, utils::GetInteger(overscan, "right")); |
| 206 EXPECT_EQ(4, utils::GetInteger(overscan, "bottom")); | 207 EXPECT_EQ(4, utils::GetInteger(overscan, "bottom")); |
| 207 | 208 |
| 208 EXPECT_EQ("display_id", provider_->GetSetInfoDisplayId()); | 209 EXPECT_EQ("display_id", provider_->GetSetInfoDisplayId()); |
| 209 } | 210 } |
| 210 #endif // defined(OS_CHROMEOS) | 211 #endif // defined(OS_CHROMEOS) |
| 211 | 212 |
| 212 } // namespace extensions | 213 } // namespace extensions |
| OLD | NEW |