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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 private: | 32 private: |
33 mojo::Binding<UrlTest> binding_; | 33 mojo::Binding<UrlTest> binding_; |
34 }; | 34 }; |
35 | 35 |
36 // Mojo version of chrome IPC test in url/ipc/url_param_traits_unittest.cc. | 36 // Mojo version of chrome IPC test in url/ipc/url_param_traits_unittest.cc. |
37 TEST(MojoGURLStructTraitsTest, Basic) { | 37 TEST(MojoGURLStructTraitsTest, Basic) { |
38 base::MessageLoop message_loop; | 38 base::MessageLoop message_loop; |
39 | 39 |
40 mojom::UrlTestPtr proxy; | 40 mojom::UrlTestPtr proxy; |
41 UrlTestImpl impl(GetProxy(&proxy)); | 41 UrlTestImpl impl(MakeRequest(&proxy)); |
42 | 42 |
43 const char* serialize_cases[] = { | 43 const char* serialize_cases[] = { |
44 "http://www.google.com/", | 44 "http://www.google.com/", |
45 "http://user:pass@host.com:888/foo;bar?baz#nop", | 45 "http://user:pass@host.com:888/foo;bar?baz#nop", |
46 }; | 46 }; |
47 | 47 |
48 for (size_t i = 0; i < arraysize(serialize_cases); i++) { | 48 for (size_t i = 0; i < arraysize(serialize_cases); i++) { |
49 GURL input(serialize_cases[i]); | 49 GURL input(serialize_cases[i]); |
50 GURL output; | 50 GURL output; |
51 EXPECT_TRUE(proxy->BounceUrl(input, &output)); | 51 EXPECT_TRUE(proxy->BounceUrl(input, &output)); |
(...skipping 29 matching lines...) Expand all Loading... |
81 EXPECT_TRUE(proxy->BounceOrigin(non_unique, &output)); | 81 EXPECT_TRUE(proxy->BounceOrigin(non_unique, &output)); |
82 EXPECT_EQ(non_unique, output); | 82 EXPECT_EQ(non_unique, output); |
83 EXPECT_FALSE(non_unique.unique()); | 83 EXPECT_FALSE(non_unique.unique()); |
84 | 84 |
85 Origin unique; | 85 Origin unique; |
86 EXPECT_TRUE(proxy->BounceOrigin(unique, &output)); | 86 EXPECT_TRUE(proxy->BounceOrigin(unique, &output)); |
87 EXPECT_TRUE(output.unique()); | 87 EXPECT_TRUE(output.unique()); |
88 } | 88 } |
89 | 89 |
90 } // namespace url | 90 } // namespace url |
OLD | NEW |