OLD | NEW |
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(gfx::NativeWindow context, |
51 gfx::NativeWindow parent, | 51 gfx::NativeWindow parent, |
52 const base::string16& app_name, | 52 const base::string16& app_name, |
| 53 const base::string16& target_name, |
53 scoped_ptr<DesktopMediaList> model, | 54 scoped_ptr<DesktopMediaList> model, |
54 const DoneCallback& done_callback) OVERRIDE { | 55 const DoneCallback& done_callback) OVERRIDE { |
55 if (!expectation_->cancelled) { | 56 if (!expectation_->cancelled) { |
56 // Post a task to call the callback asynchronously. | 57 // Post a task to call the callback asynchronously. |
57 base::ThreadTaskRunnerHandle::Get()->PostTask( | 58 base::ThreadTaskRunnerHandle::Get()->PostTask( |
58 FROM_HERE, | 59 FROM_HERE, |
59 base::Bind(&FakeDesktopMediaPicker::CallCallback, | 60 base::Bind(&FakeDesktopMediaPicker::CallCallback, |
60 weak_factory_.GetWeakPtr(), done_callback)); | 61 weak_factory_.GetWeakPtr(), done_callback)); |
61 } else { | 62 } else { |
62 // If we expect the dialog to be cancelled then store the callback to | 63 // If we expect the dialog to be cancelled then store the callback to |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 EXPECT_TRUE(result); | 233 EXPECT_TRUE(result); |
233 EXPECT_TRUE(test_flags[2].picker_created); | 234 EXPECT_TRUE(test_flags[2].picker_created); |
234 EXPECT_FALSE(test_flags[2].picker_deleted); | 235 EXPECT_FALSE(test_flags[2].picker_deleted); |
235 | 236 |
236 web_contents->Close(); | 237 web_contents->Close(); |
237 destroyed_watcher.Wait(); | 238 destroyed_watcher.Wait(); |
238 EXPECT_TRUE(test_flags[2].picker_deleted); | 239 EXPECT_TRUE(test_flags[2].picker_deleted); |
239 } | 240 } |
240 | 241 |
241 } // namespace extensions | 242 } // namespace extensions |
OLD | NEW |