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

Unified Diff: shell/application_manager/application_manager_unittest.cc

Issue 1026293002: Aggregate parameters through mappings. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix androdi build Created 5 years, 9 months 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 1683ab8252d9f7b301193d2eb2732ae2e8498665..19edcff0bde63ac72381dc0d0c957a8289e7f62c 100644
--- a/shell/application_manager/application_manager_unittest.cc
+++ b/shell/application_manager/application_manager_unittest.cc
@@ -527,6 +527,53 @@ TEST_F(ApplicationManagerTest, Args) {
EXPECT_EQ(args[1], app_args[1]);
}
+// Confirm that arguments are aggregated through mappings.
+TEST_F(ApplicationManagerTest, ArgsAndMapping) {
+ ApplicationManager am(&test_delegate_);
+ GURL test_url("test:test");
+ GURL test_url2("test:test2");
+ test_delegate_.AddMapping(test_url, test_url2);
+ std::vector<std::string> args;
+ args.push_back("test_arg1");
+ args.push_back("test_arg2");
+ am.SetArgsForURL(args, test_url);
+ std::vector<std::string> args2;
+ args2.push_back("test_arg3");
+ args2.push_back("test_arg4");
+ am.SetArgsForURL(args2, test_url2);
+ TestApplicationLoader* loader = new TestApplicationLoader;
+ loader->set_context(&context_);
+ am.SetLoaderForURL(scoped_ptr<ApplicationLoader>(loader), test_url2);
+ {
+ // Connext to the mapped url
+ TestServicePtr test_service;
+ am.ConnectToService(test_url, &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() + args2.size(), app_args.size());
+ EXPECT_EQ(args[0], app_args[0]);
+ EXPECT_EQ(args[1], app_args[1]);
+ EXPECT_EQ(args2[0], app_args[2]);
+ EXPECT_EQ(args2[1], app_args[3]);
+ }
+ {
+ // Connext to the target url
+ TestServicePtr test_service;
+ am.ConnectToService(test_url2, &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() + args2.size(), app_args.size());
+ EXPECT_EQ(args[0], app_args[0]);
+ EXPECT_EQ(args[1], app_args[1]);
+ EXPECT_EQ(args2[0], app_args[2]);
+ EXPECT_EQ(args2[1], app_args[3]);
+ }
+}
+
TEST_F(ApplicationManagerTest, ClientError) {
test_client_->Test("test");
EXPECT_TRUE(HasFactoryForTestURL());
« 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