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

Side by Side Diff: mojo/shell/android/tests/src/org/chromium/mojo/shell/ShellTestBase.java

Issue 1049993002: Get mojo_shell building inside chromium checkout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit Created 5 years, 8 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.mojo.shell;
6
7 import android.content.Context;
8 import android.content.res.AssetManager;
9
10 import org.chromium.base.CalledByNative;
11 import org.chromium.base.JNINamespace;
12
13 import java.io.File;
14 import java.io.IOException;
15
16 /**
17 * Helper method for ShellTestBase.
18 */
19 @JNINamespace("mojo::shell::test")
20 public class ShellTestBase {
21 // Directory where applications bundled with the tests will be extracted.
22 private static final String TEST_APP_DIRECTORY = "test_apps";
23
24 /**
25 * Extracts the mojo applications from the apk assets and returns the direct ory where they are.
26 */
27 @CalledByNative
28 private static String extractMojoApplications(Context context) throws IOExce ption {
29 final File outputDirectory = context.getDir(TEST_APP_DIRECTORY, Context. MODE_PRIVATE);
30
31 AssetManager manager = context.getResources().getAssets();
32 for (String asset : manager.list("")) {
33 if (asset.endsWith(".mojo")) {
34 FileHelper.extractFromAssets(context, asset, outputDirectory, fa lse);
35 }
36 }
37
38 return outputDirectory.getAbsolutePath();
39 }
40 }
OLDNEW
« no previous file with comments | « mojo/shell/android/run_android_application_function.h ('k') | mojo/shell/android/ui_application_loader_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698