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

Side by Side Diff: content/shell/android/browsertests_apk/content_browser_tests_android.cc

Issue 54923002: Android: Allow duplicate calls to InitApplicationContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/app/android/content_main.cc ('k') | mojo/shell/android/mojo_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This class sets up the environment for running the content browser tests 5 // This class sets up the environment for running the content browser tests
6 // inside an android application. 6 // inside an android application.
7 7
8 #include <android/log.h> 8 #include <android/log.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 jobject obj, 54 jobject obj,
55 jstring jfiles_dir, 55 jstring jfiles_dir,
56 jobject app_context) { 56 jobject app_context) {
57 // Command line basic initialization, will be fully initialized later. 57 // Command line basic initialization, will be fully initialized later.
58 static const char* const kInitialArgv[] = { "ContentBrowserTestsActivity" }; 58 static const char* const kInitialArgv[] = { "ContentBrowserTestsActivity" };
59 CommandLine::Init(arraysize(kInitialArgv), kInitialArgv); 59 CommandLine::Init(arraysize(kInitialArgv), kInitialArgv);
60 60
61 // Set the application context in base. 61 // Set the application context in base.
62 base::android::ScopedJavaLocalRef<jobject> scoped_context( 62 base::android::ScopedJavaLocalRef<jobject> scoped_context(
63 env, env->NewLocalRef(app_context)); 63 env, env->NewLocalRef(app_context));
64 base::android::InitApplicationContext(scoped_context); 64 base::android::InitApplicationContext(env, scoped_context);
65 base::android::RegisterJni(env); 65 base::android::RegisterJni(env);
66 66
67 std::vector<std::string> args; 67 std::vector<std::string> args;
68 ParseArgsFromCommandLineFile(kCommandLineFilePath, &args); 68 ParseArgsFromCommandLineFile(kCommandLineFilePath, &args);
69 69
70 std::vector<char*> argv; 70 std::vector<char*> argv;
71 int argc = ArgsToArgv(args, &argv); 71 int argc = ArgsToArgv(args, &argv);
72 72
73 // Fully initialize command line with arguments. 73 // Fully initialize command line with arguments.
74 CommandLine* command_line = CommandLine::ForCurrentProcess(); 74 CommandLine* command_line = CommandLine::ForCurrentProcess();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 if (!content::NestedMessagePumpAndroid::RegisterJni(env)) 110 if (!content::NestedMessagePumpAndroid::RegisterJni(env))
111 return -1; 111 return -1;
112 112
113 if (!content::RegisterNativesImpl(env)) 113 if (!content::RegisterNativesImpl(env))
114 return -1; 114 return -1;
115 115
116 content::SetContentMainDelegate(new content::ShellMainDelegate()); 116 content::SetContentMainDelegate(new content::ShellMainDelegate());
117 return JNI_VERSION_1_4; 117 return JNI_VERSION_1_4;
118 } 118 }
OLDNEW
« no previous file with comments | « content/app/android/content_main.cc ('k') | mojo/shell/android/mojo_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698