Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: ui/display/chromeos/display_configurator_unittest.cc

Issue 584533002: Don't enable HDCP again if it is active (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/display/chromeos/display_configurator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..15ee2d93d11fb1aac0affcc99de5384aca74357a 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);
+ log_->GetActionsAndClear();
+
+ // 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.
+ 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();
« no previous file with comments | « ui/display/chromeos/display_configurator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698