summaryrefslogtreecommitdiffstats
path: root/chrome/browser/media/router/presentation_request_unittest.cc
blob: 7d21a5e4177a382749a1203c98992e2b5f4cd03a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/media/router/presentation_request.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace media_router {

TEST(PresentationRequestTest, Equals) {
  PresentationRequest request1(RenderFrameHostId(1, 2),
                               "http://presentationUrl",
                               GURL("http://frameUrl"));

  // Frame IDs are different.
  PresentationRequest request2(RenderFrameHostId(3, 4),
                               "http://presentationUrl",
                               GURL("http://frameUrl"));
  EXPECT_FALSE(request1.Equals(request2));

  // Presentation URLs are different.
  PresentationRequest request3(RenderFrameHostId(1, 2),
                               "http://anotherPresentationUrl",
                               GURL("http://frameUrl"));
  EXPECT_FALSE(request1.Equals(request3));

  // Frame URLs are different.
  PresentationRequest request4(RenderFrameHostId(1, 2),
                               "http://presentationUrl",
                               GURL("http://anotherFrameUrl"));
  EXPECT_FALSE(request1.Equals(request4));

  PresentationRequest request5(RenderFrameHostId(1, 2),
                               "http://presentationUrl",
                               GURL("http://frameUrl"));
  EXPECT_TRUE(request1.Equals(request5));
}

}  // namespace media_router