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

Unified Diff: chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc

Issue 1880693002: Desktop Capture Picker New UI: Preliminary Refactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit Created 4 years, 8 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 | « no previous file | chrome/browser/extensions/api/desktop_capture/desktop_capture_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
index d2d78e2cc24cd24f0998e5d2ecc223ad2b679f68..a74b1c9dbfaf14cbfbabc19bf2eca436584cd8c7 100644
--- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
+++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <queue>
+#include <array>
#include "base/command_line.h"
#include "base/macros.h"
@@ -56,7 +56,9 @@ class FakeDesktopMediaPicker : public DesktopMediaPicker {
gfx::NativeWindow parent,
const base::string16& app_name,
const base::string16& target_name,
- std::unique_ptr<DesktopMediaList> model,
+ std::unique_ptr<DesktopMediaList> screen_list,
+ std::unique_ptr<DesktopMediaList> window_list,
+ std::unique_ptr<DesktopMediaList> tab_list,
bool request_audio,
const DoneCallback& done_callback) override {
if (!expectation_->cancelled) {
@@ -98,18 +100,28 @@ class FakeDesktopMediaPickerFactory :
}
// DesktopCaptureChooseDesktopMediaFunction::PickerFactory interface.
- std::unique_ptr<DesktopMediaList> CreateModel(bool show_screens,
- bool show_windows,
- bool show_tabs,
- bool show_audio) override {
+ MediaListArray CreateModel(
+ bool show_screens,
+ bool show_windows,
+ bool show_tabs,
+ bool show_audio) override {
EXPECT_LE(current_test_, tests_count_);
- if (current_test_ >= tests_count_)
- return std::unique_ptr<DesktopMediaList>();
+ MediaListArray media_lists;
+ if (current_test_ >= tests_count_) {
+ return media_lists;
+ }
EXPECT_EQ(test_flags_[current_test_].expect_screens, show_screens);
EXPECT_EQ(test_flags_[current_test_].expect_windows, show_windows);
EXPECT_EQ(test_flags_[current_test_].expect_tabs, show_tabs);
EXPECT_EQ(test_flags_[current_test_].expect_audio, show_audio);
- return std::unique_ptr<DesktopMediaList>(new FakeDesktopMediaList());
+
+ media_lists[0] = std::unique_ptr<DesktopMediaList>(
+ show_screens ? new FakeDesktopMediaList() : nullptr);
+ media_lists[1] = std::unique_ptr<DesktopMediaList>(
+ show_windows ? new FakeDesktopMediaList() : nullptr);
+ media_lists[2] = std::unique_ptr<DesktopMediaList>(
+ show_tabs ? new FakeDesktopMediaList() : nullptr);
+ return media_lists;
}
std::unique_ptr<DesktopMediaPicker> CreatePicker() override {
« no previous file with comments | « no previous file | chrome/browser/extensions/api/desktop_capture/desktop_capture_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698