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

Side by Side Diff: testing/android/junit/java/src/org/chromium/testing/local/GNManifestFactory.java

Issue 2710343003: Update Robolectric to 3.2.2 (Closed)
Patch Set: Small fix to StripLayoutHelperTest Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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.testing.local;
6
7 import org.robolectric.annotation.Config;
8 import org.robolectric.internal.ManifestFactory;
9 import org.robolectric.internal.ManifestIdentifier;
10 import org.robolectric.manifest.AndroidManifest;
11
12 // TODO(mikecase): Add support for specifying the AndroidManifest for
13 // Robolectric tests.
14
15 /**
16 * Class that manages passing Android manifest information to Robolectric.
17 */
18 public class GNManifestFactory implements ManifestFactory {
19 private static final String DEFAULT_PACKAGE_NAME = "org.robolectric.default" ;
20
21 @Override
22 public ManifestIdentifier identify(Config config) {
23 if (!config.manifest().equals(Config.NONE)) {
24 throw new RuntimeException("Specifying custom manifest not currently supported. "
25 + "Please use annotation @Config(manifest = Config.NONE) on Robolectric tests "
26 + "for the time being.");
27 }
28 return new ManifestIdentifier(null, null, null, config.packageName(), nu ll);
29 }
30
31 @Override
32 public AndroidManifest create(ManifestIdentifier manifestIdentifier) {
33 String packageName = manifestIdentifier.getPackageName();
34 if (packageName == null || packageName.equals("")) {
35 packageName = DEFAULT_PACKAGE_NAME;
36 }
37
38 return new AndroidManifest(null, null, null, packageName);
39 }
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698