OLD | NEW |
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 "base/base_paths.h" | 5 #include "base/base_paths.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 pingable2->Ping("hello", callback); | 177 pingable2->Ping("hello", callback); |
178 base::RunLoop().Run(); | 178 base::RunLoop().Run(); |
179 } | 179 } |
180 | 180 |
181 // mojo: URLs can have querystrings too | 181 // mojo: URLs can have querystrings too |
182 TEST_F(ShellAppTest, MojoURLQueryHandling) { | 182 TEST_F(ShellAppTest, MojoURLQueryHandling) { |
183 InterfacePtr<Pingable> pingable; | 183 InterfacePtr<Pingable> pingable; |
184 application_impl()->ConnectToService("mojo:pingable_app?foo", &pingable); | 184 application_impl()->ConnectToService("mojo:pingable_app?foo", &pingable); |
185 auto callback = [this](const String& app_url, const String& connection_url, | 185 auto callback = [this](const String& app_url, const String& connection_url, |
186 const String& message) { | 186 const String& message) { |
187 EXPECT_TRUE(EndsWith(app_url, "/pingable_app.mojo", true)); | 187 EXPECT_TRUE(base::EndsWith(app_url, "/pingable_app.mojo", true)); |
188 EXPECT_EQ(app_url.To<std::string>() + "?foo", connection_url); | 188 EXPECT_EQ(app_url.To<std::string>() + "?foo", connection_url); |
189 EXPECT_EQ("hello", message); | 189 EXPECT_EQ("hello", message); |
190 base::MessageLoop::current()->Quit(); | 190 base::MessageLoop::current()->Quit(); |
191 }; | 191 }; |
192 pingable->Ping("hello", callback); | 192 pingable->Ping("hello", callback); |
193 base::RunLoop().Run(); | 193 base::RunLoop().Run(); |
194 } | 194 } |
195 | 195 |
196 } // namespace | 196 } // namespace |
197 } // namespace mojo | 197 } // namespace mojo |
OLD | NEW |