Chromium Code Reviews| Index: ui/display/chromeos/display_configurator_unittest.cc |
| diff --git a/ui/display/chromeos/display_configurator_unittest.cc b/ui/display/chromeos/display_configurator_unittest.cc |
| index 70768bfef0e1a9d5ba0d2bfea844fe38badcdefc..92b599d957d28690ac2e272ddfc9c3274e5f34f7 100644 |
| --- a/ui/display/chromeos/display_configurator_unittest.cc |
| +++ b/ui/display/chromeos/display_configurator_unittest.cc |
| @@ -1177,14 +1177,43 @@ TEST_F(DisplayConfiguratorTest, ContentProtectionTwoClients) { |
| // Protections will be disabled only if no more clients request them. |
| EXPECT_TRUE(configurator_.EnableContentProtection( |
| client2, outputs_[1].display_id(), CONTENT_PROTECTION_METHOD_NONE)); |
| - EXPECT_EQ(GetSetHDCPStateAction(outputs_[1], HDCP_STATE_DESIRED).c_str(), |
| - log_->GetActionsAndClear()); |
| + EXPECT_EQ(kNoActions, log_->GetActionsAndClear()); |
| EXPECT_TRUE(configurator_.EnableContentProtection( |
| client1, outputs_[1].display_id(), CONTENT_PROTECTION_METHOD_NONE)); |
| EXPECT_EQ(GetSetHDCPStateAction(outputs_[1], HDCP_STATE_UNDESIRED).c_str(), |
| log_->GetActionsAndClear()); |
| } |
| +TEST_F(DisplayConfiguratorTest, ContentProtectionTwoClientsEnable) { |
| + DisplayConfigurator::ContentProtectionClientId client1 = |
| + configurator_.RegisterContentProtectionClient(); |
| + DisplayConfigurator::ContentProtectionClientId client2 = |
| + configurator_.RegisterContentProtectionClient(); |
| + EXPECT_NE(client1, client2); |
| + |
| + configurator_.Init(false); |
| + configurator_.ForceInitialConfigure(0); |
| + UpdateOutputs(2, true); |
| + EXPECT_NE(kNoActions, log_->GetActionsAndClear()); |
|
Daniel Erat
2014/09/19 15:45:55
i'd remove the EXPECT_NE() here; your test doesn't
kcwu
2014/09/23 05:43:22
Done.
|
| + |
| + // Only enable once if HDCP is enabling. |
| + EXPECT_TRUE(configurator_.EnableContentProtection( |
| + client1, outputs_[1].display_id(), CONTENT_PROTECTION_METHOD_HDCP)); |
| + native_display_delegate_->set_hdcp_state(HDCP_STATE_DESIRED); |
| + EXPECT_TRUE(configurator_.EnableContentProtection( |
| + client2, outputs_[1].display_id(), CONTENT_PROTECTION_METHOD_HDCP)); |
| + EXPECT_EQ(GetSetHDCPStateAction(outputs_[1], HDCP_STATE_DESIRED).c_str(), |
| + log_->GetActionsAndClear()); |
| + native_display_delegate_->set_hdcp_state(HDCP_STATE_ENABLED); |
| + |
| + // Don't enable again if HDCP is already active |
|
Daniel Erat
2014/09/19 15:45:55
nit: add a trailing period to this sentence
kcwu
2014/09/23 05:43:22
Done.
|
| + EXPECT_TRUE(configurator_.EnableContentProtection( |
| + client1, outputs_[1].display_id(), CONTENT_PROTECTION_METHOD_HDCP)); |
| + EXPECT_TRUE(configurator_.EnableContentProtection( |
| + client2, outputs_[1].display_id(), CONTENT_PROTECTION_METHOD_HDCP)); |
| + EXPECT_EQ(kNoActions, log_->GetActionsAndClear()); |
| +} |
| + |
| TEST_F(DisplayConfiguratorTest, HandleConfigureCrtcFailure) { |
| InitWithSingleOutput(); |