| Index: ash/display/display_color_manager_chromeos_unittest.cc
|
| diff --git a/ash/display/display_color_manager_chromeos_unittest.cc b/ash/display/display_color_manager_chromeos_unittest.cc
|
| index 081042e8a6c9018434b992bee9ca55f068d5e9ba..777ed44366ea8cdc27e1564b586b60cede09457f 100644
|
| --- a/ash/display/display_color_manager_chromeos_unittest.cc
|
| +++ b/ash/display/display_color_manager_chromeos_unittest.cc
|
| @@ -98,18 +98,17 @@ TEST_F(DisplayColorManagerTest, VCGTOnly) {
|
| std::vector<const ui::DisplayMode*> modes;
|
| ui::DisplayMode mode(gfx::Size(1024, 768), false, 60.0f);
|
| modes.push_back(&mode);
|
| - scoped_ptr<ui::TestDisplaySnapshot> snapshot =
|
| - make_scoped_ptr(new ui::TestDisplaySnapshot(
|
| - 123, gfx::Point(0, 0), /* origin */
|
| - gfx::Size(0, 0), /* physical_size */
|
| - ui::DISPLAY_CONNECTION_TYPE_INTERNAL, /* type */
|
| - false, /* is_aspect_preserving_scaling */
|
| - 0x06af5c10, /* product_id */
|
| - modes, /* modes */
|
| - modes[0] /* current_mode */,
|
| - modes[0] /* native_mode */));
|
| + ui::TestDisplaySnapshot snapshot(
|
| + 123, gfx::Point(0, 0), /* origin */
|
| + gfx::Size(0, 0), /* physical_size */
|
| + ui::DISPLAY_CONNECTION_TYPE_INTERNAL, /* type */
|
| + false, /* is_aspect_preserving_scaling */
|
| + 0x06af5c10, /* product_id */
|
| + false, /* has_color_correction_matrix */
|
| + modes, /* modes */
|
| + modes[0] /* current_mode */, modes[0] /* native_mode */);
|
| std::vector<ui::DisplaySnapshot*> outputs;
|
| - outputs.push_back(snapshot.get());
|
| + outputs.push_back(&snapshot);
|
| native_display_delegate_->set_outputs(outputs);
|
|
|
| configurator_.OnConfigurationChanged();
|
| @@ -120,25 +119,105 @@ TEST_F(DisplayColorManagerTest, VCGTOnly) {
|
|
|
| EXPECT_TRUE(base::MatchPattern(
|
| log_->GetActionsAndClear(),
|
| - "set_gamma_ramp(id=123,rgb[0]*rgb[255]=???????????\?)"));
|
| + "set_color_correction(id=123,gamma[0]*gamma[255]=???????????\?)"));
|
| +}
|
| +
|
| +TEST_F(DisplayColorManagerTest, VCGTOnlyWithPlatformCTM) {
|
| + std::vector<const ui::DisplayMode*> modes;
|
| + ui::DisplayMode mode(gfx::Size(1024, 768), false, 60.0f);
|
| + modes.push_back(&mode);
|
| + ui::TestDisplaySnapshot snapshot(
|
| + 123, gfx::Point(0, 0), /* origin */
|
| + gfx::Size(0, 0), /* physical_size */
|
| + ui::DISPLAY_CONNECTION_TYPE_INTERNAL, /* type */
|
| + false, /* is_aspect_preserving_scaling */
|
| + 0x06af5c10, /* product_id */
|
| + true, /* has_color_correction_matrix */
|
| + modes, /* modes */
|
| + modes[0] /* current_mode */, modes[0] /* native_mode */);
|
| + std::vector<ui::DisplaySnapshot*> outputs;
|
| + outputs.push_back(&snapshot);
|
| + native_display_delegate_->set_outputs(outputs);
|
| +
|
| + configurator_.OnConfigurationChanged();
|
| + EXPECT_TRUE(test_api_.TriggerConfigureTimeout());
|
| + log_->GetActionsAndClear();
|
| +
|
| + RunBlockingPoolTask();
|
| +
|
| + EXPECT_TRUE(base::MatchPattern(
|
| + log_->GetActionsAndClear(),
|
| + "set_color_correction(id=123,gamma[0]*gamma[255]=???????????\?)"));
|
| +}
|
| +
|
| +TEST_F(DisplayColorManagerTest, FullWithPlatformCTM) {
|
| + std::vector<const ui::DisplayMode*> modes;
|
| + ui::DisplayMode mode(gfx::Size(1024, 768), false, 60.0f);
|
| + modes.push_back(&mode);
|
| + ui::TestDisplaySnapshot snapshot(
|
| + 123, gfx::Point(0, 0), /* origin */
|
| + gfx::Size(0, 0), /* physical_size */
|
| + ui::DISPLAY_CONNECTION_TYPE_INTERNAL, /* type */
|
| + false, /* is_aspect_preserving_scaling */
|
| + 0x4c834a42, /* product_id */
|
| + true, /* has_color_correction_matrix */
|
| + modes, /* modes */
|
| + modes[0] /* current_mode */, modes[0] /* native_mode */);
|
| + std::vector<ui::DisplaySnapshot*> outputs;
|
| + outputs.push_back(&snapshot);
|
| + native_display_delegate_->set_outputs(outputs);
|
| +
|
| + configurator_.OnConfigurationChanged();
|
| + EXPECT_TRUE(test_api_.TriggerConfigureTimeout());
|
| + log_->GetActionsAndClear();
|
| +
|
| + RunBlockingPoolTask();
|
| +
|
| + EXPECT_TRUE(base::MatchPattern(
|
| + log_->GetActionsAndClear(),
|
| + "set_color_correction(id=123,degamma[0]*gamma[0]*ctm[0]*ctm[8]*)"));
|
| +}
|
| +
|
| +TEST_F(DisplayColorManagerTest, FullWithoutPlatformCTM) {
|
| + std::vector<const ui::DisplayMode*> modes;
|
| + ui::DisplayMode mode(gfx::Size(1024, 768), false, 60.0f);
|
| + modes.push_back(&mode);
|
| + ui::TestDisplaySnapshot snapshot(
|
| + 123, gfx::Point(0, 0), /* origin */
|
| + gfx::Size(0, 0), /* physical_size */
|
| + ui::DISPLAY_CONNECTION_TYPE_INTERNAL, /* type */
|
| + false, /* is_aspect_preserving_scaling */
|
| + 0x4c834a42, /* product_id */
|
| + false, /* has_color_correction_matrix */
|
| + modes, /* modes */
|
| + modes[0] /* current_mode */, modes[0] /* native_mode */);
|
| + std::vector<ui::DisplaySnapshot*> outputs;
|
| + outputs.push_back(&snapshot);
|
| + native_display_delegate_->set_outputs(outputs);
|
| +
|
| + configurator_.OnConfigurationChanged();
|
| + EXPECT_TRUE(test_api_.TriggerConfigureTimeout());
|
| + log_->GetActionsAndClear();
|
| +
|
| + RunBlockingPoolTask();
|
| + EXPECT_STREQ("", log_->GetActionsAndClear().c_str());
|
| }
|
|
|
| TEST_F(DisplayColorManagerTest, NoMatchProductID) {
|
| std::vector<const ui::DisplayMode*> modes;
|
| ui::DisplayMode mode(gfx::Size(1024, 768), false, 60.0f);
|
| modes.push_back(&mode);
|
| - scoped_ptr<ui::TestDisplaySnapshot> snapshot =
|
| - make_scoped_ptr(new ui::TestDisplaySnapshot(
|
| - 123, gfx::Point(0, 0), /* origin */
|
| - gfx::Size(0, 0), /* physical_size */
|
| - ui::DISPLAY_CONNECTION_TYPE_INTERNAL, /* type */
|
| - false, /* is_aspect_preserving_scaling */
|
| - 0, /* product_id */
|
| - modes, /* modes */
|
| - modes[0] /* current_mode */,
|
| - modes[0] /* native_mode */));
|
| + ui::TestDisplaySnapshot snapshot(
|
| + 123, gfx::Point(0, 0), /* origin */
|
| + gfx::Size(0, 0), /* physical_size */
|
| + ui::DISPLAY_CONNECTION_TYPE_INTERNAL, /* type */
|
| + false, /* is_aspect_preserving_scaling */
|
| + 0, /* product_id */
|
| + false, /* has_color_correction_matrix */
|
| + modes, /* modes */
|
| + modes[0] /* current_mode */, modes[0] /* native_mode */);
|
| std::vector<ui::DisplaySnapshot*> outputs;
|
| - outputs.push_back(snapshot.get());
|
| + outputs.push_back(&snapshot);
|
| native_display_delegate_->set_outputs(outputs);
|
|
|
| configurator_.OnConfigurationChanged();
|
| @@ -153,18 +232,17 @@ TEST_F(DisplayColorManagerTest, NoVCGT) {
|
| std::vector<const ui::DisplayMode*> modes;
|
| ui::DisplayMode mode(gfx::Size(1024, 768), false, 60.0f);
|
| modes.push_back(&mode);
|
| - scoped_ptr<ui::TestDisplaySnapshot> snapshot =
|
| - make_scoped_ptr(new ui::TestDisplaySnapshot(
|
| - 123, gfx::Point(0, 0), /* origin */
|
| - gfx::Size(0, 0), /* physical_size */
|
| - ui::DISPLAY_CONNECTION_TYPE_INTERNAL, /* type */
|
| - false, /* is_aspect_preserving_scaling */
|
| - 0x0dae3211, /* product_id */
|
| - modes, /* modes */
|
| - modes[0] /* current_mode */,
|
| - modes[0] /* native_mode */));
|
| + ui::TestDisplaySnapshot snapshot(
|
| + 123, gfx::Point(0, 0), /* origin */
|
| + gfx::Size(0, 0), /* physical_size */
|
| + ui::DISPLAY_CONNECTION_TYPE_INTERNAL, /* type */
|
| + false, /* is_aspect_preserving_scaling */
|
| + 0x0dae3211, /* product_id */
|
| + false, /* has_color_correction_matrix */
|
| + modes, /* modes */
|
| + modes[0] /* current_mode */, modes[0] /* native_mode */);
|
| std::vector<ui::DisplaySnapshot*> outputs;
|
| - outputs.push_back(snapshot.get());
|
| + outputs.push_back(&snapshot);
|
| native_display_delegate_->set_outputs(outputs);
|
|
|
| configurator_.OnConfigurationChanged();
|
|
|