Commit 74a271c9 authored by Dominik Laskowski's avatar Dominik Laskowski Committed by Commit Bot

display: Refactor ApplyContentProtectionTask

This CL modernizes style and removes repetitive code.

Bug: 929449
Test: display_unittests
Change-Id: I55e360d833a5dae345c071f0ba431cd89d68f39e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1553504Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Auto-Submit: Dominik Laskowski <domlaskowski@chromium.org>
Commit-Queue: Dominik Laskowski <domlaskowski@chromium.org>
Cr-Commit-Position: refs/heads/master@{#648732}
parent ca66c32f
...@@ -4,8 +4,12 @@ ...@@ -4,8 +4,12 @@
#include "ui/display/manager/apply_content_protection_task.h" #include "ui/display/manager/apply_content_protection_task.h"
#include <utility>
#include <vector>
#include "base/bind.h" #include "base/bind.h"
#include "ui/display/manager/display_layout_manager.h" #include "ui/display/manager/display_layout_manager.h"
#include "ui/display/manager/display_util.h"
#include "ui/display/types/display_snapshot.h" #include "ui/display/types/display_snapshot.h"
#include "ui/display/types/native_display_delegate.h" #include "ui/display/types/native_display_delegate.h"
...@@ -17,24 +21,12 @@ bool GetHDCPCapableDisplays( ...@@ -17,24 +21,12 @@ bool GetHDCPCapableDisplays(
const DisplayLayoutManager& layout_manager, const DisplayLayoutManager& layout_manager,
std::vector<DisplaySnapshot*>* hdcp_capable_displays) { std::vector<DisplaySnapshot*>* hdcp_capable_displays) {
for (DisplaySnapshot* display : layout_manager.GetDisplayStates()) { for (DisplaySnapshot* display : layout_manager.GetDisplayStates()) {
switch (display->type()) { uint32_t protection_mask;
case DISPLAY_CONNECTION_TYPE_UNKNOWN: if (!GetContentProtectionMethods(display->type(), &protection_mask))
return false; return false;
// DisplayPort, DVI, and HDMI all support HDCP.
case DISPLAY_CONNECTION_TYPE_DISPLAYPORT: if (protection_mask & CONTENT_PROTECTION_METHOD_HDCP)
case DISPLAY_CONNECTION_TYPE_DVI: hdcp_capable_displays->push_back(display);
case DISPLAY_CONNECTION_TYPE_HDMI:
hdcp_capable_displays->push_back(display);
break;
case DISPLAY_CONNECTION_TYPE_INTERNAL:
case DISPLAY_CONNECTION_TYPE_VGA:
case DISPLAY_CONNECTION_TYPE_NETWORK:
// No protections for these types. Do nothing.
break;
case DISPLAY_CONNECTION_TYPE_NONE:
NOTREACHED();
break;
}
} }
return true; return true;
...@@ -45,28 +37,25 @@ bool GetHDCPCapableDisplays( ...@@ -45,28 +37,25 @@ bool GetHDCPCapableDisplays(
ApplyContentProtectionTask::ApplyContentProtectionTask( ApplyContentProtectionTask::ApplyContentProtectionTask(
DisplayLayoutManager* layout_manager, DisplayLayoutManager* layout_manager,
NativeDisplayDelegate* native_display_delegate, NativeDisplayDelegate* native_display_delegate,
const DisplayConfigurator::ContentProtections& requests, DisplayConfigurator::ContentProtections requests,
const ResponseCallback& callback) ResponseCallback callback)
: layout_manager_(layout_manager), : layout_manager_(layout_manager),
native_display_delegate_(native_display_delegate), native_display_delegate_(native_display_delegate),
requests_(requests), requests_(std::move(requests)),
callback_(callback), callback_(std::move(callback)) {}
query_status_(true),
pending_requests_(0),
weak_ptr_factory_(this) {}
ApplyContentProtectionTask::~ApplyContentProtectionTask() {} ApplyContentProtectionTask::~ApplyContentProtectionTask() {}
void ApplyContentProtectionTask::Run() { void ApplyContentProtectionTask::Run() {
std::vector<DisplaySnapshot*> hdcp_capable_displays; std::vector<DisplaySnapshot*> hdcp_capable_displays;
if (!GetHDCPCapableDisplays(*layout_manager_, &hdcp_capable_displays)) { if (!GetHDCPCapableDisplays(*layout_manager_, &hdcp_capable_displays)) {
callback_.Run(false); std::move(callback_).Run(/*success=*/false);
return; return;
} }
pending_requests_ = hdcp_capable_displays.size(); pending_requests_ = hdcp_capable_displays.size();
if (pending_requests_ == 0) { if (pending_requests_ == 0) {
callback_.Run(true); std::move(callback_).Run(/*success=*/true);
return; return;
} }
...@@ -75,24 +64,24 @@ void ApplyContentProtectionTask::Run() { ...@@ -75,24 +64,24 @@ void ApplyContentProtectionTask::Run() {
for (DisplaySnapshot* display : hdcp_capable_displays) { for (DisplaySnapshot* display : hdcp_capable_displays) {
native_display_delegate_->GetHDCPState( native_display_delegate_->GetHDCPState(
*display, *display,
base::Bind(&ApplyContentProtectionTask::OnHDCPStateUpdate, base::BindOnce(&ApplyContentProtectionTask::OnGetHDCPState,
weak_ptr_factory_.GetWeakPtr(), display->display_id())); weak_ptr_factory_.GetWeakPtr(), display->display_id()));
} }
} }
void ApplyContentProtectionTask::OnHDCPStateUpdate(int64_t display_id, void ApplyContentProtectionTask::OnGetHDCPState(int64_t display_id,
bool success, bool success,
HDCPState state) { HDCPState state) {
query_status_ &= success; success_ &= success;
display_hdcp_state_map_[display_id] = state; hdcp_states_[display_id] = state;
pending_requests_--; pending_requests_--;
// Wait for all the requests before continuing. // Wait for all the requests before continuing.
if (pending_requests_ != 0) if (pending_requests_ != 0)
return; return;
if (!query_status_) { if (!success_) {
callback_.Run(false); std::move(callback_).Run(/*success=*/false);
return; return;
} }
...@@ -102,7 +91,7 @@ void ApplyContentProtectionTask::OnHDCPStateUpdate(int64_t display_id, ...@@ -102,7 +91,7 @@ void ApplyContentProtectionTask::OnHDCPStateUpdate(int64_t display_id,
void ApplyContentProtectionTask::ApplyProtections() { void ApplyContentProtectionTask::ApplyProtections() {
std::vector<DisplaySnapshot*> hdcp_capable_displays; std::vector<DisplaySnapshot*> hdcp_capable_displays;
if (!GetHDCPCapableDisplays(*layout_manager_, &hdcp_capable_displays)) { if (!GetHDCPCapableDisplays(*layout_manager_, &hdcp_capable_displays)) {
callback_.Run(false); std::move(callback_).Run(/*success=*/false);
return; return;
} }
...@@ -111,18 +100,18 @@ void ApplyContentProtectionTask::ApplyProtections() { ...@@ -111,18 +100,18 @@ void ApplyContentProtectionTask::ApplyProtections() {
for (DisplaySnapshot* display : hdcp_capable_displays) { for (DisplaySnapshot* display : hdcp_capable_displays) {
uint32_t desired_mask = GetDesiredProtectionMask(display->display_id()); uint32_t desired_mask = GetDesiredProtectionMask(display->display_id());
auto it = display_hdcp_state_map_.find(display->display_id()); auto it = hdcp_states_.find(display->display_id());
// If the display can't be found, the display configuration changed. // If the display can't be found, the display configuration changed.
if (it == display_hdcp_state_map_.end()) { if (it == hdcp_states_.end()) {
callback_.Run(false); std::move(callback_).Run(/*success=*/false);
return; return;
} }
bool hdcp_enabled = it->second != HDCP_STATE_UNDESIRED; bool hdcp_enabled = it->second != HDCP_STATE_UNDESIRED;
bool hdcp_requested = desired_mask & CONTENT_PROTECTION_METHOD_HDCP; bool hdcp_requested = desired_mask & CONTENT_PROTECTION_METHOD_HDCP;
if (hdcp_enabled != hdcp_requested) { if (hdcp_enabled != hdcp_requested) {
hdcp_requests.push_back(std::make_pair( hdcp_requests.emplace_back(
display, hdcp_requested ? HDCP_STATE_DESIRED : HDCP_STATE_UNDESIRED)); display, hdcp_requested ? HDCP_STATE_DESIRED : HDCP_STATE_UNDESIRED);
} }
} }
...@@ -130,24 +119,24 @@ void ApplyContentProtectionTask::ApplyProtections() { ...@@ -130,24 +119,24 @@ void ApplyContentProtectionTask::ApplyProtections() {
// All the requested changes are the same as the current HDCP state. Nothing // All the requested changes are the same as the current HDCP state. Nothing
// to do anymore, just ack the content protection change. // to do anymore, just ack the content protection change.
if (pending_requests_ == 0) { if (pending_requests_ == 0) {
callback_.Run(true); std::move(callback_).Run(/*success=*/true);
return; return;
} }
for (const auto& pair : hdcp_requests) { for (const auto& pair : hdcp_requests) {
native_display_delegate_->SetHDCPState( native_display_delegate_->SetHDCPState(
*pair.first, pair.second, *pair.first, pair.second,
base::Bind(&ApplyContentProtectionTask::OnHDCPStateApplied, base::BindOnce(&ApplyContentProtectionTask::OnSetHDCPState,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
} }
} }
void ApplyContentProtectionTask::OnHDCPStateApplied(bool success) { void ApplyContentProtectionTask::OnSetHDCPState(bool success) {
query_status_ &= success; success_ &= success;
pending_requests_--; pending_requests_--;
if (pending_requests_ == 0) if (pending_requests_ == 0)
callback_.Run(query_status_); std::move(callback_).Run(success_);
} }
uint32_t ApplyContentProtectionTask::GetDesiredProtectionMask( uint32_t ApplyContentProtectionTask::GetDesiredProtectionMask(
...@@ -157,7 +146,7 @@ uint32_t ApplyContentProtectionTask::GetDesiredProtectionMask( ...@@ -157,7 +146,7 @@ uint32_t ApplyContentProtectionTask::GetDesiredProtectionMask(
// In non-mirror mode, only request of client's display needs to be // In non-mirror mode, only request of client's display needs to be
// fulfilled. // fulfilled.
if (layout_manager_->IsMirroring()) { if (layout_manager_->IsMirroring()) {
for (auto pair : requests_) for (const auto& pair : requests_)
desired_mask |= pair.second; desired_mask |= pair.second;
} else { } else {
auto it = requests_.find(display_id); auto it = requests_.find(display_id);
......
...@@ -5,12 +5,10 @@ ...@@ -5,12 +5,10 @@
#ifndef UI_DISPLAY_MANAGER_APPLY_CONTENT_PROTECTION_TASK_H_ #ifndef UI_DISPLAY_MANAGER_APPLY_CONTENT_PROTECTION_TASK_H_
#define UI_DISPLAY_MANAGER_APPLY_CONTENT_PROTECTION_TASK_H_ #define UI_DISPLAY_MANAGER_APPLY_CONTENT_PROTECTION_TASK_H_
#include <stddef.h> #include <cstddef>
#include <stdint.h> #include <cstdint>
#include <map>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "ui/display/manager/display_configurator.h" #include "ui/display/manager/display_configurator.h"
...@@ -24,61 +22,47 @@ class NativeDisplayDelegate; ...@@ -24,61 +22,47 @@ class NativeDisplayDelegate;
// manner: // manner:
// 1) Run() // 1) Run()
// a) Query NativeDisplayDelegate for HDCP state on capable displays // a) Query NativeDisplayDelegate for HDCP state on capable displays
// b) OnHDCPStateUpdate() called for each display as response to (a) // b) OnGetHDCPState() called for each display as response to (a)
// 2) ApplyProtections() // 2) ApplyProtections()
// a) Compute preferred HDCP state for capable displays // a) Compute preferred HDCP state for capable displays
// b) Call into NativeDisplayDelegate to set HDCP state on capable displays // b) Call into NativeDisplayDelegate to set HDCP state on capable displays
// c) OnHDCPStateApplied() called for each display as reponse to (b) // c) OnSetHDCPState() called for each display as response to (b)
// 3) Call |callback_| to signal end of task. // 3) Call |callback_| to signal end of task.
// //
// Note, in steps 1a and 2a, if no HDCP capable displays are found or if errors // Note, in steps 1a and 2a, if no HDCP capable displays are found or if errors
// are reported, the task finishes early and skips to step 3. // are reported, the task finishes early and skips to step 3.
class DISPLAY_MANAGER_EXPORT ApplyContentProtectionTask { class DISPLAY_MANAGER_EXPORT ApplyContentProtectionTask {
public: public:
typedef base::Callback<void(bool)> ResponseCallback; using ResponseCallback = base::OnceCallback<void(bool success)>;
ApplyContentProtectionTask( ApplyContentProtectionTask(DisplayLayoutManager* layout_manager,
DisplayLayoutManager* layout_manager, NativeDisplayDelegate* native_display_delegate,
NativeDisplayDelegate* native_display_delegate, DisplayConfigurator::ContentProtections requests,
const DisplayConfigurator::ContentProtections& requests, ResponseCallback callback);
const ResponseCallback& callback);
~ApplyContentProtectionTask(); ~ApplyContentProtectionTask();
void Run(); void Run();
private: private:
// Callback to NatvieDisplayDelegate::GetHDCPState() void OnGetHDCPState(int64_t display_id, bool success, HDCPState state);
void OnHDCPStateUpdate(int64_t display_id, bool success, HDCPState state); void OnSetHDCPState(bool success);
// Callback to NativeDisplayDelegate::SetHDCPState()
void OnHDCPStateApplied(bool success);
void ApplyProtections(); void ApplyProtections();
uint32_t GetDesiredProtectionMask(int64_t display_id) const; uint32_t GetDesiredProtectionMask(int64_t display_id) const;
DisplayLayoutManager* layout_manager_; // Not owned. DisplayLayoutManager* const layout_manager_; // Not owned.
NativeDisplayDelegate* const native_display_delegate_; // Not owned.
NativeDisplayDelegate* native_display_delegate_; // Not owned.
DisplayConfigurator::ContentProtections requests_; const DisplayConfigurator::ContentProtections requests_;
// Callback used to respond once the task finishes.
ResponseCallback callback_; ResponseCallback callback_;
// Mapping between display IDs and the HDCP state returned by base::flat_map<int64_t /* display_id */, HDCPState> hdcp_states_;
// NativeDisplayDelegate.
std::map<int64_t, HDCPState> display_hdcp_state_map_;
// Tracks the status of the NativeDisplayDelegate responses. This will be true
// if all the queries were successful, false otherwise.
bool query_status_;
// Tracks the number of NativeDisplayDelegate requests sent but not answered bool success_ = true;
// yet. size_t pending_requests_ = 0;
size_t pending_requests_;
base::WeakPtrFactory<ApplyContentProtectionTask> weak_ptr_factory_; base::WeakPtrFactory<ApplyContentProtectionTask> weak_ptr_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ApplyContentProtectionTask); DISALLOW_COPY_AND_ASSIGN(ApplyContentProtectionTask);
}; };
......
...@@ -37,28 +37,29 @@ std::unique_ptr<DisplaySnapshot> CreateDisplaySnapshot( ...@@ -37,28 +37,29 @@ std::unique_ptr<DisplaySnapshot> CreateDisplaySnapshot(
class ApplyContentProtectionTaskTest : public testing::Test { class ApplyContentProtectionTaskTest : public testing::Test {
public: public:
enum Response { enum class Response {
ERROR, ERROR,
SUCCESS, SUCCESS,
NOT_CALLED, NOT_CALLED,
}; };
ApplyContentProtectionTaskTest() ApplyContentProtectionTaskTest() = default;
: response_(NOT_CALLED), display_delegate_(&log_) {} ~ApplyContentProtectionTaskTest() override = default;
~ApplyContentProtectionTaskTest() override {}
void ResponseCallback(bool success) { response_ = success ? SUCCESS : ERROR; } void ResponseCallback(bool success) {
response_ = success ? Response::SUCCESS : Response::ERROR;
}
protected: protected:
Response response_; Response response_ = Response::NOT_CALLED;
ActionLogger log_; ActionLogger log_;
TestNativeDisplayDelegate display_delegate_; TestNativeDisplayDelegate display_delegate_{&log_};
private: private:
DISALLOW_COPY_AND_ASSIGN(ApplyContentProtectionTaskTest); DISALLOW_COPY_AND_ASSIGN(ApplyContentProtectionTaskTest);
}; };
TEST_F(ApplyContentProtectionTaskTest, ApplyWithNoHDCPCapableDisplay) { TEST_F(ApplyContentProtectionTaskTest, ApplyHdcpToInternalDisplay) {
std::vector<std::unique_ptr<DisplaySnapshot>> displays; std::vector<std::unique_ptr<DisplaySnapshot>> displays;
displays.push_back( displays.push_back(
CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_INTERNAL)); CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_INTERNAL));
...@@ -73,11 +74,11 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyWithNoHDCPCapableDisplay) { ...@@ -73,11 +74,11 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyWithNoHDCPCapableDisplay) {
base::Unretained(this))); base::Unretained(this)));
task.Run(); task.Run();
EXPECT_EQ(SUCCESS, response_); EXPECT_EQ(Response::SUCCESS, response_);
EXPECT_EQ(kNoActions, log_.GetActionsAndClear()); EXPECT_EQ(kNoActions, log_.GetActionsAndClear());
} }
TEST_F(ApplyContentProtectionTaskTest, ApplyWithHDMIDisplay) { TEST_F(ApplyContentProtectionTaskTest, ApplyHdcpToExternalDisplay) {
std::vector<std::unique_ptr<DisplaySnapshot>> displays; std::vector<std::unique_ptr<DisplaySnapshot>> displays;
displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI)); displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI));
TestDisplayLayoutManager layout_manager(std::move(displays), TestDisplayLayoutManager layout_manager(std::move(displays),
...@@ -91,7 +92,7 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyWithHDMIDisplay) { ...@@ -91,7 +92,7 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyWithHDMIDisplay) {
base::Unretained(this))); base::Unretained(this)));
task.Run(); task.Run();
EXPECT_EQ(SUCCESS, response_); EXPECT_EQ(Response::SUCCESS, response_);
EXPECT_EQ( EXPECT_EQ(
JoinActions(GetSetHDCPStateAction(*layout_manager.GetDisplayStates()[0], JoinActions(GetSetHDCPStateAction(*layout_manager.GetDisplayStates()[0],
HDCP_STATE_DESIRED) HDCP_STATE_DESIRED)
...@@ -100,7 +101,7 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyWithHDMIDisplay) { ...@@ -100,7 +101,7 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyWithHDMIDisplay) {
log_.GetActionsAndClear()); log_.GetActionsAndClear());
} }
TEST_F(ApplyContentProtectionTaskTest, ApplyWithUnknownDisplay) { TEST_F(ApplyContentProtectionTaskTest, ApplyHdcpToUnknownDisplay) {
std::vector<std::unique_ptr<DisplaySnapshot>> displays; std::vector<std::unique_ptr<DisplaySnapshot>> displays;
displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_UNKNOWN)); displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_UNKNOWN));
TestDisplayLayoutManager layout_manager(std::move(displays), TestDisplayLayoutManager layout_manager(std::move(displays),
...@@ -114,11 +115,11 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyWithUnknownDisplay) { ...@@ -114,11 +115,11 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyWithUnknownDisplay) {
base::Unretained(this))); base::Unretained(this)));
task.Run(); task.Run();
EXPECT_EQ(ERROR, response_); EXPECT_EQ(Response::ERROR, response_);
EXPECT_EQ(kNoActions, log_.GetActionsAndClear()); EXPECT_EQ(kNoActions, log_.GetActionsAndClear());
} }
TEST_F(ApplyContentProtectionTaskTest, FailGettingHDCPState) { TEST_F(ApplyContentProtectionTaskTest, ApplyHdcpToDisplayThatCannotGetHdcp) {
std::vector<std::unique_ptr<DisplaySnapshot>> displays; std::vector<std::unique_ptr<DisplaySnapshot>> displays;
displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI)); displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI));
TestDisplayLayoutManager layout_manager(std::move(displays), TestDisplayLayoutManager layout_manager(std::move(displays),
...@@ -133,11 +134,11 @@ TEST_F(ApplyContentProtectionTaskTest, FailGettingHDCPState) { ...@@ -133,11 +134,11 @@ TEST_F(ApplyContentProtectionTaskTest, FailGettingHDCPState) {
base::Unretained(this))); base::Unretained(this)));
task.Run(); task.Run();
EXPECT_EQ(ERROR, response_); EXPECT_EQ(Response::ERROR, response_);
EXPECT_EQ(kNoActions, log_.GetActionsAndClear()); EXPECT_EQ(kNoActions, log_.GetActionsAndClear());
} }
TEST_F(ApplyContentProtectionTaskTest, FailSettingHDCPState) { TEST_F(ApplyContentProtectionTaskTest, ApplyHdcpToDisplayThatCannotSetHdcp) {
std::vector<std::unique_ptr<DisplaySnapshot>> displays; std::vector<std::unique_ptr<DisplaySnapshot>> displays;
displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI)); displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI));
TestDisplayLayoutManager layout_manager(std::move(displays), TestDisplayLayoutManager layout_manager(std::move(displays),
...@@ -152,7 +153,7 @@ TEST_F(ApplyContentProtectionTaskTest, FailSettingHDCPState) { ...@@ -152,7 +153,7 @@ TEST_F(ApplyContentProtectionTaskTest, FailSettingHDCPState) {
base::Unretained(this))); base::Unretained(this)));
task.Run(); task.Run();
EXPECT_EQ(ERROR, response_); EXPECT_EQ(Response::ERROR, response_);
EXPECT_EQ( EXPECT_EQ(
JoinActions(GetSetHDCPStateAction(*layout_manager.GetDisplayStates()[0], JoinActions(GetSetHDCPStateAction(*layout_manager.GetDisplayStates()[0],
HDCP_STATE_DESIRED) HDCP_STATE_DESIRED)
...@@ -161,7 +162,7 @@ TEST_F(ApplyContentProtectionTaskTest, FailSettingHDCPState) { ...@@ -161,7 +162,7 @@ TEST_F(ApplyContentProtectionTaskTest, FailSettingHDCPState) {
log_.GetActionsAndClear()); log_.GetActionsAndClear());
} }
TEST_F(ApplyContentProtectionTaskTest, ApplyNoopProtection) { TEST_F(ApplyContentProtectionTaskTest, ApplyNoProtectionToExternalDisplay) {
std::vector<std::unique_ptr<DisplaySnapshot>> displays; std::vector<std::unique_ptr<DisplaySnapshot>> displays;
displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI)); displays.push_back(CreateDisplaySnapshot(1, DISPLAY_CONNECTION_TYPE_HDMI));
TestDisplayLayoutManager layout_manager(std::move(displays), TestDisplayLayoutManager layout_manager(std::move(displays),
...@@ -176,7 +177,7 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyNoopProtection) { ...@@ -176,7 +177,7 @@ TEST_F(ApplyContentProtectionTaskTest, ApplyNoopProtection) {
base::Unretained(this))); base::Unretained(this)));
task.Run(); task.Run();
EXPECT_EQ(SUCCESS, response_); EXPECT_EQ(Response::SUCCESS, response_);
EXPECT_EQ(kNoActions, log_.GetActionsAndClear()); EXPECT_EQ(kNoActions, log_.GetActionsAndClear());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment