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

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

Issue 2675743002: PPAPI: Make output protection API work with mus+ash (Closed)
Patch Set: Update Created 3 years, 10 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
Index: ui/display/manager/chromeos/display_configurator_unittest.cc
diff --git a/ui/display/manager/chromeos/display_configurator_unittest.cc b/ui/display/manager/chromeos/display_configurator_unittest.cc
index c86c811a44720999a81b5c84ea6d024beb11ad62..324e681028f52d4cef036091dbc258bb98fe0f98 100644
--- a/ui/display/manager/chromeos/display_configurator_unittest.cc
+++ b/ui/display/manager/chromeos/display_configurator_unittest.cc
@@ -258,9 +258,12 @@ class DisplayConfiguratorTest : public testing::Test {
enable_content_protection_call_count_++;
}
- void QueryContentProtectionCallback(
- const DisplayConfigurator::QueryProtectionResponse& response) {
- query_content_protection_response_ = response;
+ void QueryContentProtectionCallback(bool success,
+ uint32_t link_mask,
+ uint32_t protection_mask) {
+ query_content_protection_response_success_ = success;
+ query_content_protection_response_link_mask_ = link_mask;
+ query_content_protection_response_protection_mask_ = protection_mask;
query_content_protection_call_count_++;
}
@@ -326,8 +329,9 @@ class DisplayConfiguratorTest : public testing::Test {
ConfigurationWaiter config_waiter_;
bool enable_content_protection_status_;
int enable_content_protection_call_count_;
- DisplayConfigurator::QueryProtectionResponse
- query_content_protection_response_;
+ bool query_content_protection_response_success_;
+ uint32_t query_content_protection_response_link_mask_;
+ uint32_t query_content_protection_response_protection_mask_;
int query_content_protection_call_count_;
std::unique_ptr<DisplaySnapshot> outputs_[3];
@@ -1234,11 +1238,11 @@ TEST_F(DisplayConfiguratorTest, ContentProtection) {
base::Bind(&DisplayConfiguratorTest::QueryContentProtectionCallback,
base::Unretained(this)));
EXPECT_EQ(1, query_content_protection_call_count_);
- EXPECT_TRUE(query_content_protection_response_.success);
+ EXPECT_TRUE(query_content_protection_response_success_);
EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_INTERNAL),
- query_content_protection_response_.link_mask);
+ query_content_protection_response_link_mask_);
EXPECT_EQ(static_cast<uint32_t>(CONTENT_PROTECTION_METHOD_NONE),
- query_content_protection_response_.protection_mask);
+ query_content_protection_response_protection_mask_);
EXPECT_EQ(kNoActions, log_->GetActionsAndClear());
// Two outputs.
@@ -1249,11 +1253,11 @@ TEST_F(DisplayConfiguratorTest, ContentProtection) {
base::Bind(&DisplayConfiguratorTest::QueryContentProtectionCallback,
base::Unretained(this)));
EXPECT_EQ(2, query_content_protection_call_count_);
- EXPECT_TRUE(query_content_protection_response_.success);
+ EXPECT_TRUE(query_content_protection_response_success_);
EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_HDMI),
- query_content_protection_response_.link_mask);
+ query_content_protection_response_link_mask_);
EXPECT_EQ(static_cast<uint32_t>(CONTENT_PROTECTION_METHOD_NONE),
- query_content_protection_response_.protection_mask);
+ query_content_protection_response_protection_mask_);
EXPECT_EQ(kNoActions, log_->GetActionsAndClear());
configurator_.EnableContentProtection(
@@ -1272,11 +1276,11 @@ TEST_F(DisplayConfiguratorTest, ContentProtection) {
base::Bind(&DisplayConfiguratorTest::QueryContentProtectionCallback,
base::Unretained(this)));
EXPECT_EQ(3, query_content_protection_call_count_);
- EXPECT_TRUE(query_content_protection_response_.success);
+ EXPECT_TRUE(query_content_protection_response_success_);
EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_HDMI),
- query_content_protection_response_.link_mask);
+ query_content_protection_response_link_mask_);
EXPECT_EQ(static_cast<uint32_t>(CONTENT_PROTECTION_METHOD_HDCP),
- query_content_protection_response_.protection_mask);
+ query_content_protection_response_protection_mask_);
EXPECT_EQ(kNoActions, log_->GetActionsAndClear());
// Protections should be disabled after unregister.
@@ -1413,22 +1417,22 @@ TEST_F(DisplayConfiguratorTest, ContentProtectionTwoClients) {
base::Bind(&DisplayConfiguratorTest::QueryContentProtectionCallback,
base::Unretained(this)));
EXPECT_EQ(1, query_content_protection_call_count_);
- EXPECT_TRUE(query_content_protection_response_.success);
+ EXPECT_TRUE(query_content_protection_response_success_);
EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_HDMI),
- query_content_protection_response_.link_mask);
+ query_content_protection_response_link_mask_);
EXPECT_EQ(CONTENT_PROTECTION_METHOD_HDCP,
- query_content_protection_response_.protection_mask);
+ query_content_protection_response_protection_mask_);
configurator_.QueryContentProtectionStatus(
client2, outputs_[1]->display_id(),
base::Bind(&DisplayConfiguratorTest::QueryContentProtectionCallback,
base::Unretained(this)));
EXPECT_EQ(2, query_content_protection_call_count_);
- EXPECT_TRUE(query_content_protection_response_.success);
+ EXPECT_TRUE(query_content_protection_response_success_);
EXPECT_EQ(static_cast<uint32_t>(DISPLAY_CONNECTION_TYPE_HDMI),
- query_content_protection_response_.link_mask);
+ query_content_protection_response_link_mask_);
EXPECT_EQ(CONTENT_PROTECTION_METHOD_NONE,
- query_content_protection_response_.protection_mask);
+ query_content_protection_response_protection_mask_);
// Protections will be disabled only if no more clients request them.
configurator_.EnableContentProtection(

Powered by Google App Engine
This is Rietveld 408576698