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

Side by Side Diff: chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc

Issue 2379703002: [Presentation API] (alternative) 1-UA: send message between controller and receiver page (Closed)
Patch Set: merge with master Created 4 years, 1 month 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 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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/media/router/receiver_presentation_service_delegate_impl.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698