Bug 844239: Spacing/indentation consistency for Robocop source; r=jmaher DONTBUILD
authorGeoff Brown <gbrown@mozilla.com>
Fri, 22 Feb 2013 20:42:46 -0700
changeset 122714 cb7a7827a9a6f19baaf508e86b8c48e37d47765a
parent 122713 5b8a0abbd54c4b302e3c299349525f287ab7760d
child 122715 f6f8457d343608bc986adca400b4e70fba97a2e3
push id24356
push usergszorc@mozilla.com
push dateSun, 24 Feb 2013 01:00:12 +0000
treeherdermozilla-central@195e706140d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs844239
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 844239: Spacing/indentation consistency for Robocop source; r=jmaher DONTBUILD
mobile/android/base/tests/testAddonManager.java.in
mobile/android/base/tests/testClearPrivateData.java.in
mobile/android/base/tests/testFormHistory.java.in
mobile/android/base/tests/testPan.java.in
mobile/android/base/tests/testSettingsMenuItems.java.in
mobile/android/base/tests/testSystemPages.java.in
mobile/android/base/tests/testTabHistory.java.in
old mode 100755
new mode 100644
--- a/mobile/android/base/tests/testClearPrivateData.java.in
+++ b/mobile/android/base/tests/testClearPrivateData.java.in
@@ -15,17 +15,17 @@ public class testClearPrivateData extend
 
     @Override
     protected int getTestType() {
         return TEST_MOCHITEST;
     }
 
     public void testClearPrivateData() {
         blockForGeckoReady();
-	clearHistory();
+        clearHistory();
     }
 
     private void clearHistory() {
         // Loading a page so we are sure that there is at leats one history entry
         String url = getAbsoluteUrl("/robocop/robocop_blank_01.html");
         loadAndPaint(url);
 
         // Checking that the history list in not empty
--- a/mobile/android/base/tests/testFormHistory.java.in
+++ b/mobile/android/base/tests/testFormHistory.java.in
@@ -27,18 +27,18 @@ public class testFormHistory extends Bas
         return TEST_MOCHITEST;
     }
 
     public void testFormHistory() {
         Context context = (Context)getActivity();
         ContentResolver cr = context.getContentResolver();
         ContentValues[] cvs = new ContentValues[1];
         cvs[0] = new ContentValues();
-  
-	blockForGeckoReady();
+ 
+        blockForGeckoReady();
 
         Uri formHistoryUri;
         Uri insertUri;
         Uri expectedUri;
         int numUpdated;
         int numDeleted;
 
         try {
@@ -94,28 +94,28 @@ public class testFormHistory extends Bas
         mAsserter.is(expectedUri.toString(), insertUri.toString(), "Insert returned correct uri");
         SqliteCompare(DB_NAME, "SELECT * FROM moz_formhistory", cvs);
   
         cvs[0].put("guid", "guid");
   
         numUpdated = cr.update(formHistoryUri, cvs[0], null, null);
         mAsserter.is(1, numUpdated, "Correct number updated");
         SqliteCompare(DB_NAME, "SELECT * FROM moz_formhistory", cvs);
-  
+ 
         numDeleted = cr.delete(formHistoryUri, null, null);
         mAsserter.is(1, numDeleted, "Correct number deleted");
         cvs = new ContentValues[0];
         SqliteCompare(DB_NAME, "SELECT * FROM moz_formhistory", cvs);
     }
 
     public void tearDown() throws Exception {
-      // remove the entire signons.sqlite file
-      File profile = new File(mProfile);
-      File db = new File(profile, "formhistory.sqlite");
-      if (db.delete()) {
-          mAsserter.dumpLog("tearDown deleted "+db.toString());
-      } else {
-          mAsserter.dumpLog("tearDown did not delete "+db.toString());
-      }
+        // remove the entire signons.sqlite file
+        File profile = new File(mProfile);
+        File db = new File(profile, "formhistory.sqlite");
+        if (db.delete()) {
+            mAsserter.dumpLog("tearDown deleted "+db.toString());
+        } else {
+            mAsserter.dumpLog("tearDown did not delete "+db.toString());
+        }
 
-      super.tearDown();
+        super.tearDown();
     }
 }
--- a/mobile/android/base/tests/testPan.java.in
+++ b/mobile/android/base/tests/testPan.java.in
@@ -42,10 +42,10 @@ public class testPan extends PixelTest {
             i++;
         } while (i < 1000 && mDriver.getScrollHeight() + 2 * mDriver.getHeight() < mDriver.getPageHeight());
         // asserter.ok(i < 1000, "Less than 1000", "Should take less than 1000 drags to get to bottom of the page.");
 
         int frames = mDriver.stopFrameRecording();
         mAsserter.dumpLog("__start_report" + Integer.toString(frames) + "__end_report");
         long msecs = System.currentTimeMillis();
         mAsserter.dumpLog("__startTimestamp" + msecs + "__endTimestamp");
-    }	
+    }
 }
--- a/mobile/android/base/tests/testSettingsMenuItems.java.in
+++ b/mobile/android/base/tests/testSettingsMenuItems.java.in
@@ -1,87 +1,89 @@
 #filter substitution
 package @ANDROID_PACKAGE_NAME@.tests;
 
 import @ANDROID_PACKAGE_NAME@.*;
 
-// This patch tests the Sections present in the Settings Menu and the default values for them
+/** This patch tests the Sections present in the Settings Menu and the 
+ *  default values for them
+ */
 public class testSettingsMenuItems extends PixelTest {
-     int midWidth;
-     int midHeight;
+    int midWidth;
+    int midHeight;
 
     @Override
     protected int getTestType() {
         return TEST_MOCHITEST;
     }
 
     public void testSettingsMenuItems() {
         blockForGeckoReady();
-	midWidth = mDriver.getGeckoWidth()/2;
-	midHeight = mDriver.getGeckoHeight()/2;
+        midWidth = mDriver.getGeckoWidth()/2;
+        midHeight = mDriver.getGeckoHeight()/2;
 
         // In this First Section I've declared the strings that contain the Menu sections
 
-	// The first string contains menu sections that do not have multiple option
-	String menuItems [] = { "General", "About", "Sync", "Content", "Pinch to reflow text", "Privacy & Security", "Tell sites not to track me", "Remember passwords", "Use master password", "Show search suggestions", "Show product announcements", "Import & Export"};
-	// This string contains every menu section that have multiple selection options followed by the option that is selected by default
-	String defaultSectionsValues [] = { "Automatic updates", "Only over Wi-Fi", "Character encoding", "Don't show menu","Plugins", "Tap to play", "Text size", "Tiny", "Cookies", "Enable"};
+        // The first string contains menu sections that do not have multiple option
+        String menuItems [] = { "General", "About", "Sync", "Content", "Pinch to reflow text", "Privacy & Security", "Tell sites not to track me", "Remember passwords", "Use master password", "Show search suggestions", "Show product announcements", "Import & Export"};
+        // This string contains every menu section that have multiple selection options followed by the option that is selected by default
+        String defaultSectionsValues [] = { "Automatic updates", "Only over Wi-Fi", "Character encoding", "Don't show menu","Plugins", "Tap to play", "Text size", "Tiny", "Cookies", "Enable"};
 
-	// This string contains multiple selection options and every option available for each of them
-	String multipleSectionsOptions[][] = {
-	{ "Automatic updates", "Enable", "Only over Wi-Fi", "Disable"},
-	{ "Character encoding", "Show menu", "Don't show menu"},
-	{ "Plugins", "Enable", "Tap to play", "Disable"},
-	{ "Cookies", "Enable", "Enabled, excluding 3rd party", "Disable"},
-	{ "Clear private data", "Browsing & download history", "Form & search history", "Cookies & active logins", "Saved passwords", "Cache", "Offline website data", "Site preferences"},
-	{ "Import from Android",  "Bookmarks", "History"}
+        // This string contains multiple selection options and every option available for each of them
+        String multipleSectionsOptions[][] = {
+            { "Automatic updates", "Enable", "Only over Wi-Fi", "Disable"},
+            { "Character encoding", "Show menu", "Don't show menu"},
+            { "Plugins", "Enable", "Tap to play", "Disable"},
+            { "Cookies", "Enable", "Enabled, excluding 3rd party", "Disable"},
+            { "Clear private data", "Browsing & download history", "Form & search history", "Cookies & active logins", "Saved passwords", "Cache", "Offline website data", "Site preferences"},
+            { "Import from Android",  "Bookmarks", "History"}
         };
 
         selectMenuItem("Settings");
 
-	// Dismiss the Settings screen and verify that the view is returned to about:home page
-	mActions.sendSpecialKey(Actions.SpecialKey.BACK);
-	verifyUrl("about:home");
+        // Dismiss the Settings screen and verify that the view is returned to about:home page
         mActions.sendSpecialKey(Actions.SpecialKey.BACK);
-	mSolo.waitForText("Enter Search"); // Waiting for page title to appear to be sure that is fully loaded before opening the menu
+        verifyUrl("about:home");
+        mActions.sendSpecialKey(Actions.SpecialKey.BACK);
+        mSolo.waitForText("Enter Search"); // Waiting for page title to appear to be sure that is fully loaded before opening the menu
 
-	selectMenuItem("Settings");
-	checkMenuSections(menuItems);
-	mSolo.scrollUp(); // Scrolling up the page to have in view the top sections
-	mSolo.scrollUp(); // Repeat scroll up because the top sections were not reached
+        selectMenuItem("Settings");
+        checkMenuSections(menuItems);
+        mSolo.scrollUp(); // Scrolling up the page to have in view the top sections
+        mSolo.scrollUp(); // Repeat scroll up because the top sections were not reached
 
-	checkMenuSections(defaultSectionsValues);
-	mSolo.scrollUp(); // Scrolling up the page to have in view the top sections again
+        checkMenuSections(defaultSectionsValues);
+        mSolo.scrollUp(); // Scrolling up the page to have in view the top sections again
 
-	checkMenuSubSections(multipleSectionsOptions);
+        checkMenuSubSections(multipleSectionsOptions);
     }
+
     public void checkMenuSections(String menuItems []) {
         for (String item:menuItems) {
-             mAsserter.ok(mSolo.waitForText(item), "Waiting for  " + item + "  option", "The " + item + "  option is present");
+            mAsserter.ok(mSolo.waitForText(item), "Waiting for  " + item + "  option", "The " + item + "  option is present");
         }
     }
     // This verifies the multiple option sections sub menus
     public void checkMenuSubSections(String multipleSectionsOptions [][]) {
-	int i,j = 0;
+        int i,j = 0;
         for (i = 0; i <= multipleSectionsOptions [j].length; i++) {
-             String item = multipleSectionsOptions [i][j];
-	     mAsserter.ok(mSolo.waitForText(item), "Waiting for  " + item + "  option", "The " + item + "  option is present");
-	     mSolo.clickOnText(item);
-	     for (j = 1; j < multipleSectionsOptions [i].length; j++)	{
-		  String subMenu = multipleSectionsOptions [i][j];
-                  mAsserter.ok(mSolo.waitForText(subMenu), "Waiting for  " + subMenu + "  option", "The " + subMenu + "  option is present");
+            String item = multipleSectionsOptions [i][j];
+            mAsserter.ok(mSolo.waitForText(item), "Waiting for  " + item + "  option", "The " + item + "  option is present");
+            mSolo.clickOnText(item);
+            for (j = 1; j < multipleSectionsOptions [i].length; j++)   {
+                String subMenu = multipleSectionsOptions [i][j];
+                mAsserter.ok(mSolo.waitForText(subMenu), "Waiting for  " + subMenu + "  option", "The " + subMenu + "  option is present");
 
-                  // When reaching the specified sub menu section, for phone devices you have to scroll down the list in order to check all the options
-		  if (subMenu.equals("Offline website data")) {
-		      Device mDevice = new Device();
-		      if (mDevice.type.equals("phone")) {
-		          MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
-	                  meh.dragSync(midWidth, midHeight+100, midWidth, midHeight-100);
-		      }
-	          }
-             }
-	     mSolo.waitForText("^Cancel$");
-	     mSolo.clickOnText("^Cancel$");
-	     j = 0;
-         }
+                // When reaching the specified sub menu section, for phone devices you have to scroll down the list in order to check all the options
+                if (subMenu.equals("Offline website data")) {
+                    Device mDevice = new Device();
+                    if (mDevice.type.equals("phone")) {
+                        MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
+                        meh.dragSync(midWidth, midHeight+100, midWidth, midHeight-100);
+                    }
+                }
+            }
+            mSolo.waitForText("^Cancel$");
+            mSolo.clickOnText("^Cancel$");
+            j = 0;
+        }
     }
 }
-
--- a/mobile/android/base/tests/testSystemPages.java.in
+++ b/mobile/android/base/tests/testSystemPages.java.in
@@ -1,19 +1,20 @@
 #filter substitution
 package @ANDROID_PACKAGE_NAME@.tests;
 
 import @ANDROID_PACKAGE_NAME@.*;
 import android.app.Activity;
 import android.util.Log;
 import java.util.Arrays;
 
-/* This patch tests the System Pages first by loading system pages from
- the awesome bar and then from Firefox menu */
-    public class testSystemPages extends PixelTest {
+/** This patch tests the System Pages first by loading system pages from
+ *  the awesome bar and then from Firefox menu 
+ */
+public class testSystemPages extends PixelTest {
     Actions.EventExpecter tabEventExpecter;
     Actions.EventExpecter contentEventExpecter;
     Actions.RepeatedEventExpecter paintExpecter;
 
     final int mExpectedTabCount = 1;
 
     @Override
     protected int getTestType() {
@@ -23,79 +24,78 @@ import java.util.Arrays;
     public void testSystemPages() {
         blockForGeckoReady();
 
         String urls [] = {  "about:firefox", "about:rights", "about:home", "about:addons", "about:downloads", "about:buildconfig", "about:"};
         String expectedUrls [] = { "about:apps", "about:downloads", "about:addons", "about:"};
         String menuItems [] = { "Apps", "Downloads", "Add-ons", "Settings"};
 
         /* This first section loads system pages from the awesome bar
-	and checks that the pages are loaded in the same tab */
+           and checks that the pages are loaded in the same tab */
         checkUrl(urls);
 
-	/* Verify that the search field is not in the focus by pressing back. That will load the previous
-        about: page if there is no the keyboard to dismiss, meaning that the search field was not in focus */
-	loadUrl("about:config");
+        /* Verify that the search field is not in the focus by pressing back. That will load the previous
+           about: page if there is no the keyboard to dismiss, meaning that the search field was not in focus */
+        loadUrl("about:config");
 
-	paintExpecter = mActions.expectPaint();// Set up listener to catch the page load
+        paintExpecter = mActions.expectPaint();// Set up listener to catch the page load
 
-	// Press back to verify if the keyboard is dismissed or the previous about: page loads
+        // Press back to verify if the keyboard is dismissed or the previous about: page loads
         mActions.sendSpecialKey(Actions.SpecialKey.BACK);
-	PaintedSurface painted = waitForPaint(paintExpecter);
+        PaintedSurface painted = waitForPaint(paintExpecter);
 
-	verifyUrl("about:");// Verify that the previous about: page is loaded, meaning no keyboard was present
+        verifyUrl("about:"); // Verify that the previous about: page is loaded, meaning no keyboard was present
 
         // The second section loads system pages from Firefox menu in different tabs
         loadFromMenu(menuItems, expectedUrls);
     }
 
-     // Load from Url the about: pages,verify the Url and the tabs number
-     public void checkUrl(String urls []) {
-         for (String url:urls) {
-              loadAndPaint(url);
-              verifyTabCount(mExpectedTabCount);
-              verifyUrl(url);
-         }
-     }
+    // Load from Url the about: pages,verify the Url and the tabs number
+    public void checkUrl(String urls []) {
+        for (String url:urls) {
+            loadAndPaint(url);
+            verifyTabCount(mExpectedTabCount);
+            verifyUrl(url);
+        }
+    }
 
-     public void loadFromMenu(String menuItems [], String expectedUrls []) {
-         int expectedTabCount = mExpectedTabCount;
-         for (String item:menuItems) {
-	      paintExpecter = mActions.expectPaint();// Set up listener to catch the page load
+    public void loadFromMenu(String menuItems [], String expectedUrls []) {
+        int expectedTabCount = mExpectedTabCount;
+        for (String item:menuItems) {
+            paintExpecter = mActions.expectPaint(); // Set up listener to catch the page load
 
-              expectedTabCount++;
-	      mActions.sendSpecialKey(Actions.SpecialKey.BACK);// Press back to dismiss the awesomebar
+            expectedTabCount++;
+            mActions.sendSpecialKey(Actions.SpecialKey.BACK); // Press back to dismiss the awesomebar
 
-              int i = Arrays.asList(menuItems).indexOf(item);
+            int i = Arrays.asList(menuItems).indexOf(item);
 
-              if (!item.equals("Settings")) {
+            if (!item.equals("Settings")) {
 
-              // Set up listeners to catch the page load we're about to do
-              tabEventExpecter = mActions.expectGeckoEvent("Tab:Added");
-              contentEventExpecter = mActions.expectGeckoEvent("DOMContentLoaded");
+                // Set up listeners to catch the page load we're about to do
+                tabEventExpecter = mActions.expectGeckoEvent("Tab:Added");
+                contentEventExpecter = mActions.expectGeckoEvent("DOMContentLoaded");
 
-	      waitForPaint(paintExpecter);// waiting for the page to load
-              selectMenuItem(item);
+                waitForPaint(paintExpecter);// waiting for the page to load
+                selectMenuItem(item);
 
-              // Wait for the new tab and page to load
-              tabEventExpecter.blockForEvent();
-              contentEventExpecter.blockForEvent();
+                // Wait for the new tab and page to load
+                tabEventExpecter.blockForEvent();
+                contentEventExpecter.blockForEvent();
 
-              verifyTabCount(expectedTabCount);
-              verifyUrl(expectedUrls[i]);
-              }
-              // Make sure the about: page was loaded without opening a new tab and verify the page Url
-              else {
-              waitForPaint(paintExpecter);// waiting for the page to load
-              selectMenuItem(item);
-	      mSolo.waitForText("About");
+                verifyTabCount(expectedTabCount);
+                verifyUrl(expectedUrls[i]);
+            } else {
+                // Make sure the about: page was loaded without opening a new tab and verify the page Url
+                waitForPaint(paintExpecter); // waiting for the page to load
+                selectMenuItem(item);
+                mSolo.waitForText("About");
 
-	      paintExpecter = mActions.expectPaint();// Set up listener to catch the page load
-              mSolo.clickOnText("About");
-	      waitForPaint(paintExpecter);// Waiting for the page to load
+                paintExpecter = mActions.expectPaint(); // Set up listener to catch the page load
+                mSolo.clickOnText("About");
+                waitForPaint(paintExpecter); // Waiting for the page to load
 
-              expectedTabCount--;// Decreasing since we don't expect this in a new tab
-              verifyTabCount(expectedTabCount);
-              verifyUrl(expectedUrls[i]);// Since the page is already loaded this should be instantly
-              }
+                expectedTabCount--; // Decreasing since we don't expect this in a new tab
+                verifyTabCount(expectedTabCount);
+                verifyUrl(expectedUrls[i]); // Since the page is already loaded this should be instantly
+            }
         }
-   }
+    }
 }
old mode 100755
new mode 100644