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

Side by Side Diff: chrome/browser/media/router/presentation_request_unittest.cc

Issue 2386633003: [Media Router] Convert MediaRouter to use GURL for presentation URLs. (Closed)
Patch Set: Respond to dcheng@ comment Created 4 years, 2 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 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/media/router/presentation_request.h" 5 #include "chrome/browser/media/router/presentation_request.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace media_router { 8 namespace media_router {
9 9
10 TEST(PresentationRequestTest, Equals) { 10 TEST(PresentationRequestTest, Equals) {
11 PresentationRequest request1(RenderFrameHostId(1, 2), 11 GURL frame_url("http://www.site.com/");
12 {"http://presentationUrl"}, 12 std::vector<GURL> presentation_urls =
13 GURL("http://frameUrl")); 13 {GURL("http://www.example.com/presentation.html")};
14
15 PresentationRequest request1(RenderFrameHostId(1, 2), presentation_urls,
16 frame_url);
14 17
15 // Frame IDs are different. 18 // Frame IDs are different.
16 PresentationRequest request2(RenderFrameHostId(3, 4), 19 PresentationRequest request2(RenderFrameHostId(3, 4), presentation_urls,
17 {"http://presentationUrl"}, 20 frame_url);
18 GURL("http://frameUrl"));
19 EXPECT_FALSE(request1.Equals(request2)); 21 EXPECT_FALSE(request1.Equals(request2));
20 22
21 // Presentation URLs are different. 23 // Presentation URLs are different.
22 PresentationRequest request3(RenderFrameHostId(1, 2), 24 PresentationRequest request3(
23 {"http://anotherPresentationUrl"}, 25 RenderFrameHostId(1, 2),
24 GURL("http://frameUrl")); 26 {GURL("http://www.example.net/presentation.html")}, frame_url);
25 EXPECT_FALSE(request1.Equals(request3)); 27 EXPECT_FALSE(request1.Equals(request3));
26 28
27 // Frame URLs are different. 29 // Frame URLs are different.
28 PresentationRequest request4(RenderFrameHostId(1, 2), 30 PresentationRequest request4(RenderFrameHostId(1, 2), presentation_urls,
29 {"http://presentationUrl"}, 31 GURL("http://www.site.net/"));
30 GURL("http://anotherFrameUrl"));
31 EXPECT_FALSE(request1.Equals(request4)); 32 EXPECT_FALSE(request1.Equals(request4));
32 33
33 PresentationRequest request5(RenderFrameHostId(1, 2), 34 PresentationRequest request5(
34 {"http://presentationUrl"}, 35 RenderFrameHostId(1, 2),
35 GURL("http://frameUrl")); 36 {GURL("http://www.example.com/presentation.html")},
37 GURL("http://www.site.com/"));
36 EXPECT_TRUE(request1.Equals(request5)); 38 EXPECT_TRUE(request1.Equals(request5));
37 } 39 }
38 40
39 } // namespace media_router 41 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/media/router/presentation_request.cc ('k') | chrome/browser/media/router/presentation_service_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698