зеркало из https://github.com/mozilla/gecko-dev.git
Bug 929865 - Part 3: Replace org.mozilla.gecko.App with BrowserApp. r=bnicholson
--HG-- extra : rebase_source : 261ac97c97d3f30ead5abcdd61034c38084e491b
This commit is contained in:
Родитель
a83bceb338
Коммит
43bb92d30e
|
@ -38,12 +38,6 @@ java-tests := \
|
|||
$(wildcard $(TESTPATH)/components/*.java) \
|
||||
$(wildcard $(TESTPATH)/helpers/*.java)
|
||||
|
||||
# pre-process TestConstants.java.in
|
||||
PP_TARGETS += testconstants
|
||||
testconstants-dep := $(dir-tests)/TestConstants.java
|
||||
testconstants := $(TESTPATH)/TestConstants.java.in
|
||||
testconstants_PATH := $(dir-tests)
|
||||
|
||||
PP_TARGETS += manifest
|
||||
manifest := $(srcdir)/AndroidManifest.xml.in
|
||||
manifest_TARGET := AndroidManifest.xml
|
||||
|
|
|
@ -9,9 +9,7 @@ DEFINES['ANDROID_PACKAGE_NAME'] = CONFIG['ANDROID_PACKAGE_NAME']
|
|||
main = add_android_eclipse_project('Robocop', OBJDIR + '/AndroidManifest.xml')
|
||||
main.package_name = 'org.mozilla.roboexample.test'
|
||||
main.res = SRCDIR + '/res'
|
||||
main.recursive_make_targets += [
|
||||
OBJDIR + '/AndroidManifest.xml',
|
||||
'../../../mobile/android/base/tests/TestConstants.java']
|
||||
main.recursive_make_targets += [OBJDIR + '/AndroidManifest.xml']
|
||||
main.extra_jars += [SRCDIR + '/robotium-solo-4.3.1.jar']
|
||||
main.assets = TOPSRCDIR + '/mobile/android/base/tests/assets'
|
||||
main.referenced_projects += ['Fennec']
|
||||
|
@ -20,5 +18,3 @@ main.add_classpathentry('harness', SRCDIR,
|
|||
dstdir='harness/org/mozilla/gecko')
|
||||
main.add_classpathentry('src', TOPSRCDIR + '/mobile/android/base/tests',
|
||||
dstdir='src/org/mozilla/gecko/tests')
|
||||
main.add_classpathentry('generated', TOPOBJDIR + '/mobile/android/base/tests',
|
||||
dstdir='generated/org/mozilla/gecko/tests')
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
|
||||
<!-- If the windowSoftInputMode adjust* flag changes below, the
|
||||
setSoftInputMode call in BrowserSearch#onStop must also be updated. -->
|
||||
<activity android:name="org.mozilla.gecko.App"
|
||||
<activity android:name="org.mozilla.gecko.BrowserApp"
|
||||
android:label="@string/moz_app_displayname"
|
||||
android:taskAffinity="@ANDROID_PACKAGE_NAME@.BROWSER"
|
||||
android:alwaysRetainTaskState="true"
|
||||
|
@ -105,10 +105,18 @@
|
|||
android:theme="@style/Gecko.App">
|
||||
</activity>
|
||||
|
||||
<!-- Alias App so we can launch it from the package namespace. -->
|
||||
<!-- Fennec is shipped as the Android package named
|
||||
org.mozilla.{fennec,firefox,firefox_beta}. The internal Java package
|
||||
hierarchy inside the Android package has both an
|
||||
org.mozilla.{fennec,firefox,firefox_beta} subtree *and* an
|
||||
org.mozilla.gecko subtree. The non-org.mozilla.gecko is deprecated
|
||||
and we would like to get rid of it entirely. Until that happens, we
|
||||
have external consumers (such as intents and bookmarks) of
|
||||
non-org.mozilla.gecko Activity classes, so we define activity aliases
|
||||
for backwards compatibility. -->
|
||||
<activity-alias android:name=".App"
|
||||
android:label="@MOZ_APP_DISPLAYNAME@"
|
||||
android:targetActivity="org.mozilla.gecko.App">
|
||||
android:targetActivity="org.mozilla.gecko.BrowserApp">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
@ -262,7 +270,7 @@
|
|||
<!-- Masquerade as the Resolver so that we can be opened from the Marketplace. -->
|
||||
<activity-alias
|
||||
android:name="com.android.internal.app.ResolverActivity"
|
||||
android:targetActivity="org.mozilla.gecko.App"
|
||||
android:targetActivity="org.mozilla.gecko.BrowserApp"
|
||||
android:exported="true" />
|
||||
|
||||
<receiver android:name="org.mozilla.gecko.GeckoUpdateReceiver">
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.gecko;
|
||||
|
||||
/**
|
||||
* This class serves only as a namespace wrapper for BrowserApp.
|
||||
*/
|
||||
public class App extends BrowserApp {}
|
|
@ -25,7 +25,7 @@ public class AppConstants {
|
|||
/**
|
||||
* The name of the Java class that launches the browser.
|
||||
*/
|
||||
public static final String BROWSER_INTENT_CLASS_NAME = "org.mozilla.gecko.App";
|
||||
public static final String BROWSER_INTENT_CLASS_NAME = "org.mozilla.gecko.BrowserApp";
|
||||
|
||||
public static final String GRE_MILESTONE = "@GRE_MILESTONE@";
|
||||
|
||||
|
|
|
@ -112,16 +112,16 @@ import android.widget.RelativeLayout;
|
|||
import android.widget.Toast;
|
||||
import android.widget.ViewFlipper;
|
||||
|
||||
abstract public class BrowserApp extends GeckoApp
|
||||
implements TabsPanel.TabsLayoutChangeListener,
|
||||
PropertyAnimator.PropertyAnimationListener,
|
||||
View.OnKeyListener,
|
||||
LayerView.OnMetricsChangedListener,
|
||||
BrowserSearch.OnSearchListener,
|
||||
BrowserSearch.OnEditSuggestionListener,
|
||||
HomePager.OnNewTabsListener,
|
||||
OnUrlOpenListener,
|
||||
ActionModeCompat.Presenter {
|
||||
public class BrowserApp extends GeckoApp
|
||||
implements TabsPanel.TabsLayoutChangeListener,
|
||||
PropertyAnimator.PropertyAnimationListener,
|
||||
View.OnKeyListener,
|
||||
LayerView.OnMetricsChangedListener,
|
||||
BrowserSearch.OnSearchListener,
|
||||
BrowserSearch.OnEditSuggestionListener,
|
||||
HomePager.OnNewTabsListener,
|
||||
OnUrlOpenListener,
|
||||
ActionModeCompat.Presenter {
|
||||
private static final String LOGTAG = "GeckoBrowserApp";
|
||||
|
||||
private static final int TABS_ANIMATION_DURATION = 450;
|
||||
|
|
|
@ -28,7 +28,7 @@ public class GlobalConstants {
|
|||
public static final String MOZ_APP_DISPLAYNAME = "@MOZ_APP_DISPLAYNAME@";
|
||||
public static final String MOZ_APP_VERSION = "@MOZ_APP_VERSION@";
|
||||
public static final String BROWSER_INTENT_PACKAGE = "org.mozilla.gecko";
|
||||
public static final String BROWSER_INTENT_CLASS = BROWSER_INTENT_PACKAGE + ".App";
|
||||
public static final String BROWSER_INTENT_CLASS = BROWSER_INTENT_PACKAGE + ".BrowserApp";
|
||||
|
||||
/**
|
||||
* Bug 800244: this signing-level permission protects broadcast intents that
|
||||
|
|
|
@ -128,7 +128,6 @@ gbjar.sources += [
|
|||
'animation/Rotate3DAnimation.java',
|
||||
'animation/ViewHelper.java',
|
||||
'ANRReporter.java',
|
||||
'App.java',
|
||||
'AppNotificationClient.java',
|
||||
'Assert.java',
|
||||
'BaseGeckoInterface.java',
|
||||
|
|
|
@ -12,6 +12,8 @@ import org.mozilla.gecko.FennecMochitestAssert;
|
|||
import org.mozilla.gecko.FennecNativeDriver;
|
||||
import org.mozilla.gecko.FennecTalosAssert;
|
||||
|
||||
import org.mozilla.gecko.AppConstants;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
import android.util.Log;
|
||||
|
@ -24,6 +26,25 @@ public abstract class BaseRobocopTest extends ActivityInstrumentationTestCase2<A
|
|||
|
||||
private static final String DEFAULT_ROOT_PATH = "/mnt/sdcard/tests";
|
||||
|
||||
/**
|
||||
* The Java Class instance that launches the browser.
|
||||
* <p>
|
||||
* This should always agree with {@link AppConstants#BROWSER_INTENT_CLASS_NAME}.
|
||||
*/
|
||||
public static final Class<? extends Activity> BROWSER_INTENT_CLASS;
|
||||
|
||||
// Use reflection here so we don't have to preprocess this file.
|
||||
static {
|
||||
Class<? extends Activity> cl;
|
||||
try {
|
||||
cl = (Class<? extends Activity>) Class.forName(AppConstants.BROWSER_INTENT_CLASS_NAME);
|
||||
} catch (ClassNotFoundException e) {
|
||||
// Oh well.
|
||||
cl = Activity.class;
|
||||
}
|
||||
BROWSER_INTENT_CLASS = cl;
|
||||
}
|
||||
|
||||
protected Assert mAsserter;
|
||||
protected String mLogFile;
|
||||
|
||||
|
@ -41,7 +62,7 @@ public abstract class BaseRobocopTest extends ActivityInstrumentationTestCase2<A
|
|||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public BaseRobocopTest() {
|
||||
this((Class<Activity>) TestConstants.BROWSER_INTENT_CLASS);
|
||||
this((Class<Activity>) BROWSER_INTENT_CLASS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#filter substitution
|
||||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.gecko.tests;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import org.mozilla.gecko.App;
|
||||
|
||||
public class TestConstants {
|
||||
/**
|
||||
* The Java Class instance that launches the browser.
|
||||
* <p>
|
||||
* This should always agree with {@link AppConstants#BROWSER_INTENT_CLASS_NAME}.
|
||||
*/
|
||||
public static final Class<? extends Activity> BROWSER_INTENT_CLASS = org.mozilla.gecko.App.class;
|
||||
}
|
Загрузка…
Ссылка в новой задаче