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 "chrome/browser/ui/webui/media_router/media_router_ui.h" | 5 #include "chrome/browser/ui/webui/media_router/media_router_ui.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 using testing::Return; | 37 using testing::Return; |
38 | 38 |
39 namespace media_router { | 39 namespace media_router { |
40 | 40 |
41 class PresentationRequestCallbacks { | 41 class PresentationRequestCallbacks { |
42 public: | 42 public: |
43 explicit PresentationRequestCallbacks( | 43 explicit PresentationRequestCallbacks( |
44 const content::PresentationError& expected_error) | 44 const content::PresentationError& expected_error) |
45 : expected_error_(expected_error) {} | 45 : expected_error_(expected_error) {} |
46 | 46 |
47 void Success(const content::PresentationSessionInfo&, const MediaRoute::Id&) { | 47 void Success(const content::PresentationSessionInfo&, const MediaRoute&) {} |
48 } | |
49 | 48 |
50 void Error(const content::PresentationError& error) { | 49 void Error(const content::PresentationError& error) { |
51 EXPECT_EQ(expected_error_.error_type, error.error_type); | 50 EXPECT_EQ(expected_error_.error_type, error.error_type); |
52 EXPECT_EQ(expected_error_.message, error.message); | 51 EXPECT_EQ(expected_error_.message, error.message); |
53 } | 52 } |
54 | 53 |
55 private: | 54 private: |
56 content::PresentationError expected_error_; | 55 content::PresentationError expected_error_; |
57 }; | 56 }; |
58 | 57 |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 for (auto* observer : media_sinks_observers_) { | 553 for (auto* observer : media_sinks_observers_) { |
555 if (observer->source().id() == presentation_source_id) { | 554 if (observer->source().id() == presentation_source_id) { |
556 observer->OnSinksUpdated(sinks, origins); | 555 observer->OnSinksUpdated(sinks, origins); |
557 } | 556 } |
558 } | 557 } |
559 // Destroying the UI should return the expected error from above to the error | 558 // Destroying the UI should return the expected error from above to the error |
560 // callback. | 559 // callback. |
561 media_router_ui_.reset(); | 560 media_router_ui_.reset(); |
562 } | 561 } |
563 } // namespace media_router | 562 } // namespace media_router |
OLD | NEW |