OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/media/router/presentation_request.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 |
| 8 namespace media_router { |
| 9 |
| 10 TEST(PresentationRequestTest, Equals) { |
| 11 PresentationRequest request1(RenderFrameHostId(1, 2), |
| 12 "http://presentationUrl", |
| 13 GURL("http://frameUrl")); |
| 14 |
| 15 // Frame IDs are different. |
| 16 PresentationRequest request2(RenderFrameHostId(3, 4), |
| 17 "http://presentationUrl", |
| 18 GURL("http://frameUrl")); |
| 19 EXPECT_FALSE(request1.Equals(request2)); |
| 20 |
| 21 // Presentation URLs are different. |
| 22 PresentationRequest request3(RenderFrameHostId(1, 2), |
| 23 "http://anotherPresentationUrl", |
| 24 GURL("http://frameUrl")); |
| 25 EXPECT_FALSE(request1.Equals(request3)); |
| 26 |
| 27 // Frame URLs are different. |
| 28 PresentationRequest request4(RenderFrameHostId(1, 2), |
| 29 "http://presentationUrl", |
| 30 GURL("http://anotherFrameUrl")); |
| 31 EXPECT_FALSE(request1.Equals(request4)); |
| 32 |
| 33 PresentationRequest request5(RenderFrameHostId(1, 2), |
| 34 "http://presentationUrl", |
| 35 GURL("http://frameUrl")); |
| 36 EXPECT_TRUE(request1.Equals(request5)); |
| 37 } |
| 38 |
| 39 } // namespace media_router |
OLD | NEW |