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

Side by Side Diff: components/test_runner/mock_web_user_media_client.h

Issue 1852603002: Replacing most of web_task.h with base::Closure + base::WeakPtrFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-mocks-to-test-runner
Patch Set: Rebasing... 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_ 5 #ifndef COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_
6 #define COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_ 6 #define COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/test_runner/web_task.h" 9 #include "base/memory/weak_ptr.h"
10 #include "third_party/WebKit/public/web/WebUserMediaClient.h" 10 #include "third_party/WebKit/public/web/WebUserMediaClient.h"
11 11
12 namespace test_runner { 12 namespace test_runner {
13 13
14 class WebTestDelegate; 14 class WebTestDelegate;
15 15
16 class MockWebUserMediaClient : public blink::WebUserMediaClient { 16 class MockWebUserMediaClient : public blink::WebUserMediaClient {
17 public: 17 public:
18 explicit MockWebUserMediaClient(WebTestDelegate* delegate); 18 explicit MockWebUserMediaClient(WebTestDelegate* delegate);
19 ~MockWebUserMediaClient() override {} 19 ~MockWebUserMediaClient() override;
20 20
21 void requestUserMedia(const blink::WebUserMediaRequest&) override; 21 void requestUserMedia(const blink::WebUserMediaRequest&) override;
22 void cancelUserMediaRequest(const blink::WebUserMediaRequest&) override; 22 void cancelUserMediaRequest(const blink::WebUserMediaRequest&) override;
23 void requestMediaDevices(const blink::WebMediaDevicesRequest&) override; 23 void requestMediaDevices(const blink::WebMediaDevicesRequest&) override;
24 void cancelMediaDevicesRequest(const blink::WebMediaDevicesRequest&) override; 24 void cancelMediaDevicesRequest(const blink::WebMediaDevicesRequest&) override;
25 void requestSources(const blink::WebMediaStreamTrackSourcesRequest&) override; 25 void requestSources(const blink::WebMediaStreamTrackSourcesRequest&) override;
26 26
27 // Task related methods 27 private:
28 WebTaskList* mutable_task_list() { return &task_list_; } 28 WebTestDelegate* delegate_;
29 29
30 private: 30 base::WeakPtrFactory<MockWebUserMediaClient> weak_factory_;
31 WebTaskList task_list_;
32 WebTestDelegate* delegate_;
33 31
34 DISALLOW_COPY_AND_ASSIGN(MockWebUserMediaClient); 32 DISALLOW_COPY_AND_ASSIGN(MockWebUserMediaClient);
35 }; 33 };
36 34
37 } // namespace test_runner 35 } // namespace test_runner
38 36
39 #endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_ 37 #endif // COMPONENTS_TEST_RUNNER_MOCK_WEB_USER_MEDIA_CLIENT_H_
OLDNEW
« no previous file with comments | « components/test_runner/mock_web_speech_recognizer.cc ('k') | components/test_runner/mock_web_user_media_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698