| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/display/display_error_observer_chromeos.h" | 5 #include "ash/display/display_error_observer_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/common/system/chromeos/devicetype_utils.h" | 7 #include "ash/common/system/chromeos/devicetype_utils.h" |
| 8 #include "ash/display/display_util.h" | 8 #include "ash/display/display_util.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(DisplayErrorObserverTest); | 41 DISALLOW_COPY_AND_ASSIGN(DisplayErrorObserverTest); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 TEST_F(DisplayErrorObserverTest, Normal) { | 44 TEST_F(DisplayErrorObserverTest, Normal) { |
| 45 if (!SupportsMultipleDisplays()) | 45 if (!SupportsMultipleDisplays()) |
| 46 return; | 46 return; |
| 47 | 47 |
| 48 UpdateDisplay("200x200,300x300"); | 48 UpdateDisplay("200x200,300x300"); |
| 49 observer()->OnDisplayModeChangeFailed( | 49 observer()->OnDisplayModeChangeFailed( |
| 50 ui::DisplayConfigurator::DisplayStateList(), | 50 display::DisplayConfigurator::DisplayStateList(), |
| 51 ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR); | 51 display::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR); |
| 52 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_FAILURE_ON_MIRRORING), | 52 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_FAILURE_ON_MIRRORING), |
| 53 GetMessageContents()); | 53 GetMessageContents()); |
| 54 } | 54 } |
| 55 | 55 |
| 56 TEST_F(DisplayErrorObserverTest, CallTwice) { | 56 TEST_F(DisplayErrorObserverTest, CallTwice) { |
| 57 if (!SupportsMultipleDisplays()) | 57 if (!SupportsMultipleDisplays()) |
| 58 return; | 58 return; |
| 59 | 59 |
| 60 UpdateDisplay("200x200,300x300"); | 60 UpdateDisplay("200x200,300x300"); |
| 61 observer()->OnDisplayModeChangeFailed( | 61 observer()->OnDisplayModeChangeFailed( |
| 62 ui::DisplayConfigurator::DisplayStateList(), | 62 display::DisplayConfigurator::DisplayStateList(), |
| 63 ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR); | 63 display::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR); |
| 64 base::string16 message = GetMessageContents(); | 64 base::string16 message = GetMessageContents(); |
| 65 EXPECT_FALSE(message.empty()); | 65 EXPECT_FALSE(message.empty()); |
| 66 | 66 |
| 67 observer()->OnDisplayModeChangeFailed( | 67 observer()->OnDisplayModeChangeFailed( |
| 68 ui::DisplayConfigurator::DisplayStateList(), | 68 display::DisplayConfigurator::DisplayStateList(), |
| 69 ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR); | 69 display::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR); |
| 70 base::string16 message2 = GetMessageContents(); | 70 base::string16 message2 = GetMessageContents(); |
| 71 EXPECT_FALSE(message2.empty()); | 71 EXPECT_FALSE(message2.empty()); |
| 72 EXPECT_EQ(message, message2); | 72 EXPECT_EQ(message, message2); |
| 73 } | 73 } |
| 74 | 74 |
| 75 TEST_F(DisplayErrorObserverTest, CallWithDifferentState) { | 75 TEST_F(DisplayErrorObserverTest, CallWithDifferentState) { |
| 76 if (!SupportsMultipleDisplays()) | 76 if (!SupportsMultipleDisplays()) |
| 77 return; | 77 return; |
| 78 | 78 |
| 79 UpdateDisplay("200x200,300x300"); | 79 UpdateDisplay("200x200,300x300"); |
| 80 observer()->OnDisplayModeChangeFailed( | 80 observer()->OnDisplayModeChangeFailed( |
| 81 ui::DisplayConfigurator::DisplayStateList(), | 81 display::DisplayConfigurator::DisplayStateList(), |
| 82 ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR); | 82 display::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR); |
| 83 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_FAILURE_ON_MIRRORING), | 83 EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_FAILURE_ON_MIRRORING), |
| 84 GetMessageContents()); | 84 GetMessageContents()); |
| 85 | 85 |
| 86 observer()->OnDisplayModeChangeFailed( | 86 observer()->OnDisplayModeChangeFailed( |
| 87 ui::DisplayConfigurator::DisplayStateList(), | 87 display::DisplayConfigurator::DisplayStateList(), |
| 88 ui::MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED); | 88 display::MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED); |
| 89 EXPECT_EQ(ash::SubstituteChromeOSDeviceType( | 89 EXPECT_EQ(ash::SubstituteChromeOSDeviceType( |
| 90 IDS_ASH_DISPLAY_FAILURE_ON_NON_MIRRORING), | 90 IDS_ASH_DISPLAY_FAILURE_ON_NON_MIRRORING), |
| 91 GetMessageContents()); | 91 GetMessageContents()); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace ash | 94 } // namespace ash |
| OLD | NEW |