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

Side by Side Diff: extensions/browser/api/display_source/display_source_apitest.cc

Issue 1603013002: [chrome.displaySource] DisplaySourceConnectionDelegate::Connection interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from Antony Created 4 years, 11 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
« no previous file with comments | « no previous file | extensions/browser/api/display_source/display_source_connection_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "content/public/test/test_utils.h" 6 #include "content/public/test/test_utils.h"
7 #include "extensions/browser/api/display_source/display_source_connection_delega te.h" 7 #include "extensions/browser/api/display_source/display_source_connection_delega te.h"
8 #include "extensions/browser/api/display_source/display_source_connection_delega te_factory.h" 8 #include "extensions/browser/api/display_source/display_source_connection_delega te_factory.h"
9 #include "extensions/shell/test/shell_apitest.h" 9 #include "extensions/shell/test/shell_apitest.h"
10 10
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 30
31 } // namespace 31 } // namespace
32 32
33 class MockDisplaySourceConnectionDelegate 33 class MockDisplaySourceConnectionDelegate
34 : public DisplaySourceConnectionDelegate { 34 : public DisplaySourceConnectionDelegate {
35 public: 35 public:
36 DisplaySourceSinkInfoList last_found_sinks() const override { return sinks_; } 36 DisplaySourceSinkInfoList last_found_sinks() const override { return sinks_; }
37 const Connection* connection() const override { return nullptr; } 37 const Connection* connection() const override { return nullptr; }
38 void GetAvailableSinks(const SinkInfoListCallback& sinks_callback, 38 void GetAvailableSinks(const SinkInfoListCallback& sinks_callback,
39 const FailureCallback& failure_callback) override { 39 const StringCallback& failure_callback) override {
40 AddSink(CreateSinkInfoPtr(1, "sink 1", SINK_STATE_DISCONNECTED)); 40 AddSink(CreateSinkInfoPtr(1, "sink 1", SINK_STATE_DISCONNECTED));
41 sinks_callback.Run(sinks_); 41 sinks_callback.Run(sinks_);
42 } 42 }
43 43
44 void RequestAuthentication(int sink_id, 44 void RequestAuthentication(int sink_id,
45 const AuthInfoCallback& auth_info_callback, 45 const AuthInfoCallback& auth_info_callback,
46 const FailureCallback& failure_callback) override { 46 const StringCallback& failure_callback) override {
47 DisplaySourceAuthInfo info; 47 DisplaySourceAuthInfo info;
48 info.method = AUTHENTICATION_METHOD_PBC; 48 info.method = AUTHENTICATION_METHOD_PBC;
49 auth_info_callback.Run(info); 49 auth_info_callback.Run(info);
50 } 50 }
51 51
52 void Connect(int sink_id, 52 void Connect(int sink_id,
53 const DisplaySourceAuthInfo& auth_info, 53 const DisplaySourceAuthInfo& auth_info,
54 const FailureCallback& failure_callback) override {} 54 const StringCallback& failure_callback) override {}
55 55
56 void Disconnect(const FailureCallback& failure_callback) override {} 56 void Disconnect(const StringCallback& failure_callback) override {}
57 57
58 void StartWatchingAvailableSinks() override { 58 void StartWatchingAvailableSinks() override {
59 AddSink(CreateSinkInfoPtr(2, "sink 2", SINK_STATE_DISCONNECTED)); 59 AddSink(CreateSinkInfoPtr(2, "sink 2", SINK_STATE_DISCONNECTED));
60 } 60 }
61 61
62 void StopWatchingAvailableSinks() override {} 62 void StopWatchingAvailableSinks() override {}
63 63
64 private: 64 private:
65 void AddSink(DisplaySourceSinkInfoPtr sink) { 65 void AddSink(DisplaySourceSinkInfoPtr sink) {
66 sinks_.push_back(sink); 66 sinks_.push_back(sink);
(...skipping 21 matching lines...) Expand all
88 browser_context(), &CreateMockDelegate); 88 browser_context(), &CreateMockDelegate);
89 content::RunAllPendingInMessageLoop(); 89 content::RunAllPendingInMessageLoop();
90 } 90 }
91 }; 91 };
92 92
93 IN_PROC_BROWSER_TEST_F(DisplaySourceApiTest, DisplaySourceExtension) { 93 IN_PROC_BROWSER_TEST_F(DisplaySourceApiTest, DisplaySourceExtension) {
94 ASSERT_TRUE(RunAppTest("api_test/display_source/api")) << message_; 94 ASSERT_TRUE(RunAppTest("api_test/display_source/api")) << message_;
95 } 95 }
96 96
97 } // namespace extensions 97 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/api/display_source/display_source_connection_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698