OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 { | 67 { |
68 const std::string url = std::string("http://example.org/").append( | 68 const std::string url = std::string("http://example.org/").append( |
69 kMaxURLChars + 1, 'a'); | 69 kMaxURLChars + 1, 'a'); |
70 GURL input(url.c_str()); | 70 GURL input(url.c_str()); |
71 GURL output; | 71 GURL output; |
72 EXPECT_TRUE(proxy->BounceUrl(input, &output)); | 72 EXPECT_TRUE(proxy->BounceUrl(input, &output)); |
73 EXPECT_TRUE(output.is_empty()); | 73 EXPECT_TRUE(output.is_empty()); |
74 } | 74 } |
75 | 75 |
76 // Test basic Origin serialization. | 76 // Test basic Origin serialization. |
77 Origin non_unique = Origin::UnsafelyCreateOriginWithoutNormalization( | 77 Origin non_opaque = Origin::UnsafelyCreateOriginWithoutNormalization( |
78 "http", "www.google.com", 80, ""); | 78 "http", "www.google.com", 80, ""); |
79 Origin output; | 79 Origin output; |
80 EXPECT_TRUE(proxy->BounceOrigin(non_unique, &output)); | 80 EXPECT_TRUE(proxy->BounceOrigin(non_opaque, &output)); |
81 EXPECT_EQ(non_unique, output); | 81 EXPECT_EQ(non_opaque, output); |
82 EXPECT_FALSE(output.unique()); | 82 EXPECT_FALSE(output.opaque()); |
83 | 83 |
84 Origin unique; | 84 Origin opaque; |
85 EXPECT_TRUE(proxy->BounceOrigin(unique, &output)); | 85 EXPECT_TRUE(proxy->BounceOrigin(opaque, &output)); |
86 EXPECT_TRUE(output.unique()); | 86 EXPECT_TRUE(output.opaque()); |
87 | 87 |
88 Origin with_sub_origin = Origin::CreateFromNormalizedTupleWithSuborigin( | 88 Origin with_sub_origin = Origin::CreateFromNormalizedTupleWithSuborigin( |
89 "http", "www.google.com", 80, "suborigin"); | 89 "http", "www.google.com", 80, "suborigin"); |
90 EXPECT_TRUE(proxy->BounceOrigin(with_sub_origin, &output)); | 90 EXPECT_TRUE(proxy->BounceOrigin(with_sub_origin, &output)); |
91 EXPECT_EQ(with_sub_origin, output); | 91 EXPECT_EQ(with_sub_origin, output); |
92 EXPECT_FALSE(output.unique()); | 92 EXPECT_FALSE(output.opaque()); |
93 } | 93 } |
94 | 94 |
95 } // namespace url | 95 } // namespace url |
OLD | NEW |