| OLD | NEW |
| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 FailureCallback& 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 base::Closure& connected_callback, | |
| 55 const FailureCallback& failure_callback) override {} | 54 const FailureCallback& failure_callback) override {} |
| 56 | 55 |
| 57 void Disconnect(const base::Closure& disconnected_callback, | 56 void Disconnect(const FailureCallback& failure_callback) override {} |
| 58 const FailureCallback& failure_callback) override {} | |
| 59 | 57 |
| 60 void StartWatchingSinks() override { | 58 void StartWatchingAvailableSinks() override { |
| 61 AddSink(CreateSinkInfoPtr(2, "sink 2", SINK_STATE_DISCONNECTED)); | 59 AddSink(CreateSinkInfoPtr(2, "sink 2", SINK_STATE_DISCONNECTED)); |
| 62 } | 60 } |
| 63 | 61 |
| 64 void StopWatchingSinks() override {} | 62 void StopWatchingAvailableSinks() override {} |
| 65 | 63 |
| 66 private: | 64 private: |
| 67 void AddSink(DisplaySourceSinkInfoPtr sink) { | 65 void AddSink(DisplaySourceSinkInfoPtr sink) { |
| 68 sinks_.push_back(sink); | 66 sinks_.push_back(sink); |
| 69 FOR_EACH_OBSERVER(DisplaySourceConnectionDelegate::Observer, observers_, | 67 FOR_EACH_OBSERVER(DisplaySourceConnectionDelegate::Observer, observers_, |
| 70 OnSinksUpdated(sinks_)); | 68 OnSinksUpdated(sinks_)); |
| 71 } | 69 } |
| 72 | 70 |
| 73 DisplaySourceSinkInfoList sinks_; | 71 DisplaySourceSinkInfoList sinks_; |
| 74 }; | 72 }; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 90 browser_context(), &CreateMockDelegate); | 88 browser_context(), &CreateMockDelegate); |
| 91 content::RunAllPendingInMessageLoop(); | 89 content::RunAllPendingInMessageLoop(); |
| 92 } | 90 } |
| 93 }; | 91 }; |
| 94 | 92 |
| 95 IN_PROC_BROWSER_TEST_F(DisplaySourceApiTest, DisplaySourceExtension) { | 93 IN_PROC_BROWSER_TEST_F(DisplaySourceApiTest, DisplaySourceExtension) { |
| 96 ASSERT_TRUE(RunAppTest("api_test/display_source/api")) << message_; | 94 ASSERT_TRUE(RunAppTest("api_test/display_source/api")) << message_; |
| 97 } | 95 } |
| 98 | 96 |
| 99 } // namespace extensions | 97 } // namespace extensions |
| OLD | NEW |