OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include <gflags/gflags.h> | 7 #include <gflags/gflags.h> |
8 #include <gtest/gtest.h> | 8 #include <gtest/gtest.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // size that'll also work for the LCD output. | 129 // size that'll also work for the LCD output. |
130 TEST_F(ResolutionSelectorTest, ExternalOutputIsMonitor) { | 130 TEST_F(ResolutionSelectorTest, ExternalOutputIsMonitor) { |
131 AddLcdMode(1024, 768); | 131 AddLcdMode(1024, 768); |
132 AddLcdMode(800, 600); | 132 AddLcdMode(800, 600); |
133 AddExternalMode(1600, 1200); | 133 AddExternalMode(1600, 1200); |
134 AddExternalMode(1280, 960); | 134 AddExternalMode(1280, 960); |
135 AddExternalMode(1024, 768); | 135 AddExternalMode(1024, 768); |
136 ASSERT_GE(external_modes_[0].width * external_modes_[0].height, | 136 ASSERT_GE(external_modes_[0].width * external_modes_[0].height, |
137 ResolutionSelector::kMaxProjectorPixels); | 137 ResolutionSelector::kMaxProjectorPixels); |
138 ASSERT_TRUE(GetResolutions()); | 138 ASSERT_TRUE(GetResolutions()); |
139 EXPECT_EQ("1024x768", lcd_resolution_); | 139 EXPECT_EQ("", lcd_resolution_); |
140 EXPECT_EQ("1600x1200", external_resolution_); | 140 EXPECT_EQ("1600x1200", external_resolution_); |
141 EXPECT_EQ("1600x1200", screen_resolution_); | 141 EXPECT_EQ("1600x1200", screen_resolution_); |
142 } | 142 } |
143 | 143 |
144 // We should just fail if there's no common resolution between the two | 144 // We should just fail if there's no common resolution between the two |
145 // outputs. | 145 // outputs. |
146 TEST_F(ResolutionSelectorTest, FailIfNoCommonResolution) { | 146 TEST_F(ResolutionSelectorTest, FailIfNoCommonResolution) { |
147 AddLcdMode(1024, 768); | 147 AddLcdMode(1024, 768); |
148 AddExternalMode(1280, 600); | 148 AddExternalMode(1280, 600); |
149 EXPECT_FALSE(GetResolutions()); | 149 EXPECT_FALSE(GetResolutions()); |
150 } | 150 } |
151 | 151 |
152 } // namespace monitor_reconfig | 152 } // namespace monitor_reconfig |
153 | 153 |
154 int main(int argc, char** argv) { | 154 int main(int argc, char** argv) { |
155 google::ParseCommandLineFlags(&argc, &argv, true); | 155 google::ParseCommandLineFlags(&argc, &argv, true); |
156 CommandLine::Init(argc, argv); | 156 CommandLine::Init(argc, argv); |
157 logging::InitLogging(NULL, | 157 logging::InitLogging(NULL, |
158 FLAGS_logtostderr ? | 158 FLAGS_logtostderr ? |
159 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG : | 159 logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG : |
160 logging::LOG_NONE, | 160 logging::LOG_NONE, |
161 logging::DONT_LOCK_LOG_FILE, | 161 logging::DONT_LOCK_LOG_FILE, |
162 logging::APPEND_TO_OLD_LOG_FILE); | 162 logging::APPEND_TO_OLD_LOG_FILE); |
163 ::testing::InitGoogleTest(&argc, argv); | 163 ::testing::InitGoogleTest(&argc, argv); |
164 return RUN_ALL_TESTS(); | 164 return RUN_ALL_TESTS(); |
165 } | 165 } |
OLD | NEW |