Bug 993136 - Fix TestSyncConfiguration. r=mcomella

========

306fb330a9
Author: Nick Alexander <nalexander@mozilla.com>
Date:   Tue Jun 3 15:29:55 2014 -0700

    Bug 993136 - Fix TestSyncConfiguration.
This commit is contained in:
Nick Alexander 2014-06-21 15:42:31 -07:00
parent 2e18f67d80
commit f6519ee881
21 changed files with 63 additions and 62 deletions

View File

@ -5,8 +5,8 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout style="@style/FxAccountMiddle" >

View File

@ -5,8 +5,8 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout style="@style/FxAccountMiddle" >

View File

@ -6,8 +6,8 @@
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout

View File

@ -5,8 +5,8 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout

View File

@ -8,7 +8,7 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android" >
<LinearLayout
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
@ -25,14 +25,14 @@
</AutoCompleteTextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<EditText
android:id="@+id/password"
style="@style/FxAccountEditItem"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/fxaccount_password_background"
@ -51,22 +51,22 @@
happy. Be thankful there are not three buttons! -->
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="fill_parent"
android:layout_weight="0"
android:orientation="horizontal" >
<Button
android:id="@+id/show_password"
style="@style/FxAccountShowHidePasswordButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/fxaccount_password_show" >
</Button>
<Button
style="@style/FxAccountShowHidePasswordButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="fill_parent"
android:text="@string/fxaccount_password_show"
android:visibility="invisible" >
</Button>
@ -74,7 +74,7 @@
<Button
style="@style/FxAccountShowHidePasswordButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="fill_parent"
android:text="@string/fxaccount_password_hide"
android:visibility="invisible" >
</Button>

View File

@ -5,8 +5,8 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout

View File

@ -19,12 +19,12 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="@android:color/transparent">
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_weight="1"
android:paddingTop="0dip"

View File

@ -6,8 +6,8 @@
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout
@ -39,7 +39,7 @@
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal" >

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/fxaccount_error_preference_backgroundcolor"
android:gravity="center_vertical"
@ -35,7 +35,7 @@
<TextView
android:id="@+android:id/title"
style="@style/FxAccountTextItem"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical" >

View File

@ -6,8 +6,8 @@
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<LinearLayout

View File

@ -5,7 +5,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="horizontal"

View File

@ -11,20 +11,20 @@
android:text="@string/sync_title_send_tab" />
<LinearLayout
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/SyncSpace" >
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/sync_title_send_tab" />
<TextView
android:id="@+id/uri"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/sync_title_send_tab" />

View File

@ -19,7 +19,7 @@
<ProgressBar
android:id="@+id/waiting_content1"
style="@style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:indeterminateOnly="true"
android:padding="@dimen/SyncSpace" />

View File

@ -6,6 +6,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/SyncLayout" >
<WebView android:id="@+id/web_engine"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>

View File

@ -7,7 +7,7 @@
<!-- Top title bar: a text view with the Sync icon to the left. -->
<style name="SyncTop" parent="@android:style/Widget.Holo.ActionBar">
<item name="android:textAppearance">@android:style/TextAppearance.Holo.Widget.ActionBar.Title</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">center_vertical|left</item>
<item name="android:drawableLeft">@drawable/icon</item>
@ -17,12 +17,12 @@
<!-- Bottom bar: a horizontal linear layout with buttons in it. -->
<style name="SyncBottom" parent="@android:style/Holo.Light.ButtonBar">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>
<style name="SyncButton" parent="@android:style/Widget.Holo.Light.Button.Small">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1</item>
<item name="android:background">?android:attr/selectableItemBackground</item>

View File

@ -16,7 +16,7 @@
<style name="FxAccountMiddle">
<item name="android:background">@android:color/white</item>
<item name="android:orientation">vertical</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1</item>
<item name="android:paddingTop">30dp</item>
@ -27,7 +27,7 @@
<style name="FxAccountSpacer">
<item name="android:orientation">vertical</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">0dp</item>
<item name="android:layout_weight">1</item>
</style>
@ -39,7 +39,7 @@
<style name="FxAccountTextItem" parent="@android:style/TextAppearance.Medium">
<item name="android:textColor">@color/fxaccount_textColor</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">center_horizontal</item>
<item name="android:textSize">16sp</item>
@ -57,7 +57,7 @@
<item name="android:textColor">@drawable/fxaccount_button_color</item>
<item name="android:textSize">24sp</item>
<item name="android:padding">20dp</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginBottom">10dp</item>
</style>
@ -81,7 +81,7 @@
<item name="android:focusable">true</item>
<item name="android:textColor">@color/fxaccount_linkified_textColor</item>
<item name="android:textColorLink">@color/fxaccount_linkified_textColorLink</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">center</item>
</style>
@ -95,7 +95,7 @@
</style>
<style name="FxAccountErrorItem">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_marginBottom">10dp</item>
<item name="android:layout_marginTop">10dp</item>
<item name="android:layout_height">wrap_content</item>
@ -118,13 +118,13 @@
<style name="FxAccountButtonLayout">
<item name="android:orientation">vertical</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:background">@drawable/fxaccount_button_background</item>
</style>
<style name="FxAccountCheckBox">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginBottom">10dp</item>
<item name="android:textColor">@drawable/fxaccount_checkbox_textcolor</item>

View File

@ -5,8 +5,8 @@
<resources>
<style name="SyncLayout">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="SyncLayout.Vertical" parent="@style/SyncLayout">
<item name="android:orientation">vertical</item>
@ -17,14 +17,14 @@
<!-- TextView Styles -->
<style name="SyncTextFrame" parent="@style/TextAppearance">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:layout_gravity">center</item>
<item name="android:padding">@dimen/SyncSpace</item>
<item name="android:orientation">vertical</item>
</style>
<style name="SyncTextItem" parent="@style/TextAppearance.Medium">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">15dp</item>
</style>
@ -44,7 +44,7 @@
</style>
<!-- EditView Styles -->
<style name="SyncEditItem" parent="@style/Widget.EditText">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:singleLine">true</item>
<item name="android:inputType">text|textNoSuggestions</item>
@ -67,7 +67,7 @@
<!-- Top title bar: a text view with the Sync icon to the left. -->
<style name="SyncTop">
<item name="android:textAppearance">@style/TextAppearance.Large</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">center_vertical|left</item>
<item name="android:drawableLeft">@drawable/icon</item>
@ -80,7 +80,7 @@
<!-- Middle scroller: a scroll view with content in it. -->
<style name="SyncMiddle">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">0dp</item>
<item name="android:layout_weight">1</item>
<item name="android:padding">@dimen/SyncSpace</item>
@ -88,7 +88,7 @@
<!-- Bottom bar: a horizontal linear layout with buttons in it. -->
<style name="SyncBottom">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">center</item>
<item name="android:gravity">center</item>
@ -104,7 +104,7 @@
</style>
<style name="SyncButton" parent="@style/Widget.Button">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1</item>
</style>

View File

@ -472,7 +472,7 @@ public class SyncConfiguration {
} else {
edit.putString(PREF_ENABLED_ENGINE_NAMES, setToJSONObjectString(enabledEngineNames));
}
if (declinedEngineNames.isEmpty()) {
if (declinedEngineNames == null || declinedEngineNames.isEmpty()) {
edit.remove(PREF_DECLINED_ENGINE_NAMES);
} else {
edit.putString(PREF_DECLINED_ENGINE_NAMES, setToJSONObjectString(declinedEngineNames));

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/app_name" />

View File

@ -44,7 +44,8 @@ public class TestSyncConfiguration extends AndroidSyncTestCase {
config.persistToPrefs();
assertFalse(prefs.contains(SyncConfiguration.PREF_DECLINED_ENGINE_NAMES));
config = newSyncConfiguration();
assertNull(config.declinedEngineNames);
assertNotNull(config.declinedEngineNames);
assertTrue(config.declinedEngineNames.isEmpty());
}
public void testEnabledEngineNames() {