Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1888)

Unified Diff: shell/application_manager/application_manager_unittest.cc

Issue 1471753002: Do not consider url query when setting application arguments. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « shell/application_manager/application_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/application_manager/application_manager_unittest.cc
diff --git a/shell/application_manager/application_manager_unittest.cc b/shell/application_manager/application_manager_unittest.cc
index 4a947283b39f5095a91197cd2968bf02718e33c7..341aea10703ab84f3e14f0d7dac7ce0e8ac20f22 100644
--- a/shell/application_manager/application_manager_unittest.cc
+++ b/shell/application_manager/application_manager_unittest.cc
@@ -527,6 +527,28 @@ TEST_F(ApplicationManagerTest, Args) {
EXPECT_EQ(args[1], app_args[1]);
}
+// Confirm that arguments are sent to an application in the presence of query
+// parameters.
+TEST_F(ApplicationManagerTest, ArgsWithQuery) {
+ ApplicationManager am(ApplicationManager::Options(), &test_delegate_);
+ GURL test_url("test:test");
+ GURL test_url_with_query("test:test?foo=bar");
+ std::vector<std::string> args;
+ args.push_back("test_arg1");
+ am.SetArgsForURL(args, test_url);
+ TestApplicationLoader* loader = new TestApplicationLoader;
+ loader->set_context(&context_);
+ am.SetLoaderForURL(scoped_ptr<ApplicationLoader>(loader), test_url);
+ TestServicePtr test_service;
+ am.ConnectToService(test_url_with_query, &test_service);
+ TestClient test_client(test_service.Pass());
+ test_client.Test("test");
+ loop_.Run();
+ std::vector<std::string> app_args = loader->GetArgs();
+ ASSERT_EQ(args.size(), app_args.size());
+ EXPECT_EQ(args[0], app_args[0]);
+}
+
// Confirm that arguments are aggregated through mappings.
TEST_F(ApplicationManagerTest, ArgsAndMapping) {
ApplicationManager am(ApplicationManager::Options(), &test_delegate_);
« no previous file with comments | « shell/application_manager/application_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698