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

Side by Side Diff: mojo/runner/shell_test_base_android.cc

Issue 1342503003: Move fetching logic out of ApplicationManager, eliminate url mappings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « mojo/runner/shell_test_base.cc ('k') | mojo/runner/switches.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/runner/shell_test_base.h" 5 #include "mojo/runner/shell_test_base.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 12 matching lines...) Expand all
23 static bool initialized = false; 23 static bool initialized = false;
24 if (!initialized) { 24 if (!initialized) {
25 RegisterNativesImpl(env); 25 RegisterNativesImpl(env);
26 initialized = true; 26 initialized = true;
27 } 27 }
28 return env; 28 return env;
29 } 29 }
30 30
31 } // namespace 31 } // namespace
32 32
33 void ShellTestBase::SetUpTestApplications() { 33 base::FilePath ShellTestBase::GetTestAppFilePath() const {
34 // Extract mojo applications, and set the resolve base URL to the directory 34 // Extract mojo applications, and set the resolve base URL to the directory
35 // containing those. 35 // containing those.
36 JNIEnv* env = InitEnv(); 36 JNIEnv* env = InitEnv();
37 base::android::ScopedJavaLocalRef<jstring> service_dir( 37 base::android::ScopedJavaLocalRef<jstring> service_dir(
38 Java_ShellTestBase_extractMojoApplications( 38 Java_ShellTestBase_extractMojoApplications(
39 env, base::android::GetApplicationContext())); 39 env, base::android::GetApplicationContext()));
40 shell_context_.url_resolver()->SetMojoBaseURL( 40 return base::FilePath(
41 mojo::util::FilePathToFileURL(base::FilePath( 41 base::android::ConvertJavaStringToUTF8(env, service_dir.obj()));
42 base::android::ConvertJavaStringToUTF8(env, service_dir.obj()))));
43 } 42 }
44 43
45 } // namespace test 44 } // namespace test
46 } // namespace runner 45 } // namespace runner
47 } // namespace mojo 46 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/runner/shell_test_base.cc ('k') | mojo/runner/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698