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

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

Issue 281383008: Made desktop capture screen tab-constrained in ASH (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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/path_service.h" 8 #include "base/path_service.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h" 10 #include "chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h"
(...skipping 29 matching lines...) Expand all
40 explicit FakeDesktopMediaPicker(TestFlags* expectation) 40 explicit FakeDesktopMediaPicker(TestFlags* expectation)
41 : expectation_(expectation), 41 : expectation_(expectation),
42 weak_factory_(this) { 42 weak_factory_(this) {
43 expectation_->picker_created = true; 43 expectation_->picker_created = true;
44 } 44 }
45 virtual ~FakeDesktopMediaPicker() { 45 virtual ~FakeDesktopMediaPicker() {
46 expectation_->picker_deleted = true; 46 expectation_->picker_deleted = true;
47 } 47 }
48 48
49 // DesktopMediaPicker interface. 49 // DesktopMediaPicker interface.
50 virtual void Show(gfx::NativeWindow context, 50 virtual void Show(content::WebContents* web_contents,
51 gfx::NativeWindow context,
51 gfx::NativeWindow parent, 52 gfx::NativeWindow parent,
52 const base::string16& app_name, 53 const base::string16& app_name,
53 const base::string16& target_name, 54 const base::string16& target_name,
54 scoped_ptr<DesktopMediaList> model, 55 scoped_ptr<DesktopMediaList> model,
55 const DoneCallback& done_callback) OVERRIDE { 56 const DoneCallback& done_callback) OVERRIDE {
56 if (!expectation_->cancelled) { 57 if (!expectation_->cancelled) {
57 // Post a task to call the callback asynchronously. 58 // Post a task to call the callback asynchronously.
58 base::ThreadTaskRunnerHandle::Get()->PostTask( 59 base::ThreadTaskRunnerHandle::Get()->PostTask(
59 FROM_HERE, 60 FROM_HERE,
60 base::Bind(&FakeDesktopMediaPicker::CallCallback, 61 base::Bind(&FakeDesktopMediaPicker::CallCallback,
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 EXPECT_TRUE(result); 234 EXPECT_TRUE(result);
234 EXPECT_TRUE(test_flags[2].picker_created); 235 EXPECT_TRUE(test_flags[2].picker_created);
235 EXPECT_FALSE(test_flags[2].picker_deleted); 236 EXPECT_FALSE(test_flags[2].picker_deleted);
236 237
237 web_contents->Close(); 238 web_contents->Close();
238 destroyed_watcher.Wait(); 239 destroyed_watcher.Wait();
239 EXPECT_TRUE(test_flags[2].picker_deleted); 240 EXPECT_TRUE(test_flags[2].picker_deleted);
240 } 241 }
241 242
242 } // namespace extensions 243 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/desktop_capture/desktop_capture_api.cc ('k') | chrome/browser/media/desktop_media_picker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698