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

Side by Side Diff: chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc

Issue 1644073002: Desktop Share Audio User Permission (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Compiler Issue Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <queue> 5 #include <queue>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 ~FakeDesktopMediaPicker() override { expectation_->picker_deleted = true; } 48 ~FakeDesktopMediaPicker() override { expectation_->picker_deleted = true; }
49 49
50 // DesktopMediaPicker interface. 50 // DesktopMediaPicker interface.
51 void Show(content::WebContents* web_contents, 51 void Show(content::WebContents* web_contents,
52 gfx::NativeWindow context, 52 gfx::NativeWindow context,
53 gfx::NativeWindow parent, 53 gfx::NativeWindow parent,
54 const base::string16& app_name, 54 const base::string16& app_name,
55 const base::string16& target_name, 55 const base::string16& target_name,
56 scoped_ptr<DesktopMediaList> model, 56 scoped_ptr<DesktopMediaList> model,
57 bool request_audio,
57 const DoneCallback& done_callback) override { 58 const DoneCallback& done_callback) override {
58 if (!expectation_->cancelled) { 59 if (!expectation_->cancelled) {
59 // Post a task to call the callback asynchronously. 60 // Post a task to call the callback asynchronously.
60 base::ThreadTaskRunnerHandle::Get()->PostTask( 61 base::ThreadTaskRunnerHandle::Get()->PostTask(
61 FROM_HERE, 62 FROM_HERE,
62 base::Bind(&FakeDesktopMediaPicker::CallCallback, 63 base::Bind(&FakeDesktopMediaPicker::CallCallback,
63 weak_factory_.GetWeakPtr(), done_callback)); 64 weak_factory_.GetWeakPtr(), done_callback));
64 } else { 65 } else {
65 // If we expect the dialog to be cancelled then store the callback to 66 // If we expect the dialog to be cancelled then store the callback to
66 // retain reference to the callback handler. 67 // retain reference to the callback handler.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 EXPECT_TRUE(result); 239 EXPECT_TRUE(result);
239 EXPECT_TRUE(test_flags[2].picker_created); 240 EXPECT_TRUE(test_flags[2].picker_created);
240 EXPECT_FALSE(test_flags[2].picker_deleted); 241 EXPECT_FALSE(test_flags[2].picker_deleted);
241 242
242 web_contents->Close(); 243 web_contents->Close();
243 destroyed_watcher.Wait(); 244 destroyed_watcher.Wait();
244 EXPECT_TRUE(test_flags[2].picker_deleted); 245 EXPECT_TRUE(test_flags[2].picker_deleted);
245 } 246 }
246 247
247 } // namespace extensions 248 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698