diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index ac424e6c3c61..7c37c7570039 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -1723,7 +1723,7 @@ let closedTabs = 0; for (let i = tabs.length - 1; i >= 0; --i) { if (tabs[i] != aTab && !tabs[i].pinned) { - this.removeTab(tabs[i]); + this.removeTab(tabs[i], {animate: true}); closedTabs++; } } diff --git a/browser/base/content/test/browser_bug577121.js b/browser/base/content/test/browser_bug577121.js index 94d169be0db8..181826543153 100644 --- a/browser/base/content/test/browser_bug577121.js +++ b/browser/base/content/test/browser_bug577121.js @@ -3,6 +3,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ function test() { + Services.prefs.setBoolPref("browser.tabs.animate", false); + registerCleanupFunction(function() { + Services.prefs.clearUserPref("browser.tabs.animate"); + }); + // Open 2 other tabs, and pin the second one. Like that, the initial tab // should get closed. let testTab1 = gBrowser.addTab(); diff --git a/browser/base/content/test/browser_bug887515.js b/browser/base/content/test/browser_bug887515.js index c4b804365767..b3e4f5dbbae2 100644 --- a/browser/base/content/test/browser_bug887515.js +++ b/browser/base/content/test/browser_bug887515.js @@ -42,7 +42,9 @@ function verifyUndoMultipleClose() { function test() { waitForExplicitFinish(); + Services.prefs.setBoolPref("browser.tabs.animate", false); registerCleanupFunction(function() { + Services.prefs.clearUserPref("browser.tabs.animate"); originalTab.linkedBrowser.loadURI("about:blank"); originalTab = null; }); diff --git a/build/pgo/index.html b/build/pgo/index.html index ba517d56124f..7e6ce301d9e5 100644 --- a/build/pgo/index.html +++ b/build/pgo/index.html @@ -157,9 +157,10 @@ window.setTimeout(loadURL, interval); }; function loadURL () { - w.location.href = list[idx++]; + w.close(); + w = window.open(list[idx++]); if (idx < list.length) { - window.setTimeout(loadURL, interval); + window.setTimeout(loadURL, interval); } else { window.setTimeout(goQuitApplication, interval); } diff --git a/mobile/android/base/home/SearchEngineRow.java b/mobile/android/base/home/SearchEngineRow.java index fc8c5143fee3..e784a318798a 100644 --- a/mobile/android/base/home/SearchEngineRow.java +++ b/mobile/android/base/home/SearchEngineRow.java @@ -138,6 +138,11 @@ class SearchEngineRow extends AnimatedHeightLayout { }); } + private void setDescriptionOnSuggestion(View v, String suggestion) { + v.setContentDescription(getResources().getString(R.string.suggestion_for_engine, + mSearchEngine.name, suggestion)); + } + private String getSuggestionTextFromView(View v) { final TextView suggestionText = (TextView) v.findViewById(R.id.suggestion_text); return suggestionText.getText().toString(); @@ -146,10 +151,17 @@ class SearchEngineRow extends AnimatedHeightLayout { private void setSuggestionOnView(View v, String suggestion) { final TextView suggestionText = (TextView) v.findViewById(R.id.suggestion_text); suggestionText.setText(suggestion); + setDescriptionOnSuggestion(suggestionText, suggestion); } public void setSearchTerm(String searchTerm) { mUserEnteredTextView.setText(searchTerm); + + // mSearchEngine is not set in the first call to this method; the content description + // is instead initially set in updateFromSearchEngine. + if (mSearchEngine != null) { + setDescriptionOnSuggestion(mUserEnteredTextView, searchTerm); + } } public void setOnUrlOpenListener(OnUrlOpenListener listener) { @@ -171,6 +183,9 @@ class SearchEngineRow extends AnimatedHeightLayout { // Set the search engine icon (e.g., Google) for the row mIconView.updateImage(mSearchEngine.icon, mSearchEngine.name); + // Set the initial content description + setDescriptionOnSuggestion(mUserEnteredTextView, mUserEnteredTextView.getText().toString()); + // Add additional suggestions given by this engine final int recycledSuggestionCount = mSuggestionView.getChildCount(); final int suggestionCount = mSearchEngine.suggestions.size(); diff --git a/mobile/android/base/locales/en-US/android_strings.dtd b/mobile/android/base/locales/en-US/android_strings.dtd index c9313ea12bda..0f3c23701cf0 100644 --- a/mobile/android/base/locales/en-US/android_strings.dtd +++ b/mobile/android/base/locales/en-US/android_strings.dtd @@ -333,6 +333,11 @@ just addresses the organization to follow, e.g. "This site is run by " --> replaced with the name of the search engine. --> + + + diff --git a/mobile/android/base/strings.xml.in b/mobile/android/base/strings.xml.in index 748e25939cb1..af43eb451f23 100644 --- a/mobile/android/base/strings.xml.in +++ b/mobile/android/base/strings.xml.in @@ -11,6 +11,8 @@ + + ]> @@ -324,6 +326,8 @@ &suggestions_prompt2; + &suggestion_for_engine; + &set_image_fail; &set_image_chooser_title; diff --git a/mobile/android/base/tests/AboutHomeTest.java.in b/mobile/android/base/tests/AboutHomeTest.java.in index 96c825cc6366..f72a57b03032 100644 --- a/mobile/android/base/tests/AboutHomeTest.java.in +++ b/mobile/android/base/tests/AboutHomeTest.java.in @@ -121,40 +121,26 @@ abstract class AboutHomeTest extends BaseTest { return null; } + /** + * Adds a bookmark, or updates the bookmark title if the url already exists. + * + * The LocalBrowserDB.addBookmark implementation handles updating existing bookmarks. + * Since we don't modify bookmark keywords in tests, we don't need a separate + * implemention of updateBookmark. + */ protected void addOrUpdateMobileBookmark(String title, String url) { - if (isBookmark(url)) { - updateBookmark(title, url, null); - } else { - addMobileBookmark(title, url); - } - } - - protected void addMobileBookmark(String title, String url) { try { ContentResolver resolver = getActivity().getContentResolver(); ClassLoader classLoader = getActivity().getClassLoader(); Class browserDB = classLoader.loadClass("org.mozilla.gecko.db.BrowserDB"); Method addBookmark = browserDB.getMethod("addBookmark", ContentResolver.class, String.class, String.class); addBookmark.invoke(null, resolver, title, url); - mAsserter.ok(true, "Inserting a new bookmark", "Inserter the bookmark with the title = " + title + " and the url = " + url); + mAsserter.ok(true, "Inserting/updating a new bookmark", "Inserting/updating the bookmark with the title = " + title + " and the url = " + url); } catch (Exception e) { mAsserter.ok(false, "Exception adding bookmark: ", e.toString()); } } - protected void updateBookmark(String title, String url, String keyword) { - try { - ContentResolver resolver = getActivity().getContentResolver(); - ClassLoader classLoader = getActivity().getClassLoader(); - Class browserDB = classLoader.loadClass("org.mozilla.gecko.db.BrowserDB"); - Method updateBookmark = browserDB.getMethod("updateBookmark", ContentResolver.class, String.class, String.class); - updateBookmark.invoke(null, resolver, title, url, keyword); - mAsserter.ok(true, "Updating existing bookmark", "Setting the values to title = " + title + ", url = " + url + " and keyword = " + keyword); - } catch (Exception e) { - mAsserter.ok(false, "Exception updating bookmark: ", e.toString()); - } - } - protected void deleteBookmark(String url) { try { ContentResolver resolver = getActivity().getContentResolver(); diff --git a/mobile/android/base/tests/robocop.ini b/mobile/android/base/tests/robocop.ini index 0a7258f89166..b57d455b0e4d 100644 --- a/mobile/android/base/tests/robocop.ini +++ b/mobile/android/base/tests/robocop.ini @@ -28,7 +28,7 @@ [testDoorHanger] [testTabHistory] [testShareLink] -# [testClearPrivateData] # disabled on fig - bug 880060 +[testClearPrivateData] [testSettingsMenuItems] [testSystemPages] # [testPermissions] # see bug 757475 diff --git a/mobile/android/base/tests/testClearPrivateData.java.in b/mobile/android/base/tests/testClearPrivateData.java.in index 2c0af57abef8..e9ae32bfc18a 100644 --- a/mobile/android/base/tests/testClearPrivateData.java.in +++ b/mobile/android/base/tests/testClearPrivateData.java.in @@ -2,9 +2,11 @@ package @ANDROID_PACKAGE_NAME@.tests; import @ANDROID_PACKAGE_NAME@.*; -import android.widget.ListView; +import java.util.ArrayList; -public class testClearPrivateData extends AboutHomeTest { +public class testClearPrivateData extends AboutHomeTest { + private final String BLANK1_TITLE = "Browser Blank Page 01"; + private final String BLANK2_TITLE = "Browser Blank Page 02"; @Override protected int getTestType() { @@ -17,29 +19,26 @@ public class testClearPrivateData extends AboutHomeTest { } private void clearHistory() { - // Loading a page so we are sure that there is at least one history entry - String url = getAbsoluteUrl("/robocop/robocop_blank_01.html"); - inputAndLoadUrl(url); + // Loading a page and adding a second one as bookmark to have user made bookmarks and history + String blank1 = getAbsoluteUrl("/robocop/robocop_blank_01.html"); + String blank2 = getAbsoluteUrl("/robocop/robocop_blank_02.html"); + + inputAndLoadUrl(blank1); + waitForText(BLANK1_TITLE); + + addOrUpdateMobileBookmark(BLANK2_TITLE, blank2); - /* Removed by Bug 896576 - [fig] Remove [getHistoryList] from BaseTest // Checking that the history list is not empty - ListView hList = getHistoryList("Today|Yesterday"); - mAsserter.ok(hList.getAdapter().getCount() > 0,"checking history exists","history exists"); + ArrayList browserHistory = getBrowserDBUrls(BrowserDataType.HISTORY); + mAsserter.ok(browserHistory.size() > 0,"Checking history exists","History exists"); - // Quit the awesomescreen - mActions.sendSpecialKey(Actions.SpecialKey.BACK); - waitForText("Browser Blank Page 01"); - - // Clearing private data - selectSettingsItem("Privacy", "Clear private data"); - mAsserter.ok(mSolo.searchButton("Clear data"),"checking clear button","clear button exists"); - mSolo.clickOnButton("Clear data"); - // TODO: extra long wait here for bug 837274 - mAsserter.is(mSolo.waitForText("Private data cleared", 0, 60000),true,"private data cleared successfully"); + clearPrivateData(); // Checking that history list is empty - hList = getHistoryList("History", 0); - mAsserter.ok(hList != null,"checking history is cleared ","history is cleared"); - */ + browserHistory = getBrowserDBUrls(BrowserDataType.HISTORY); + mAsserter.ok(browserHistory.size() == 0,"Checking history is cleared ","History is cleared"); + + // Checking that the user made bookmark is not removed + mAsserter.ok(isBookmark(blank2), "Checking that bookmarks have not been removed", "User made bookmarks were not removed with private data"); } } diff --git a/mobile/android/base/tests/testImportFromAndroid.java.in b/mobile/android/base/tests/testImportFromAndroid.java.in index 0cd48dfadb78..876404071293 100644 --- a/mobile/android/base/tests/testImportFromAndroid.java.in +++ b/mobile/android/base/tests/testImportFromAndroid.java.in @@ -110,7 +110,7 @@ public class testImportFromAndroid extends AboutHomeTest { for (String url:androidBookmarks) { // Add every 3rd bookmark to Firefox Mobile if ((androidBookmarks.indexOf(url) % 3) == 0) { - addOrUpdateMobileBookmark("Bookmar Number" + String.valueOf(androidBookmarks.indexOf(url)), url); + addOrUpdateMobileBookmark("Bookmark Number " + String.valueOf(androidBookmarks.indexOf(url)), url); } } diff --git a/testing/mochitest/mach_commands.py b/testing/mochitest/mach_commands.py index 7ec1afc08b8c..5b4fd3aa9777 100644 --- a/testing/mochitest/mach_commands.py +++ b/testing/mochitest/mach_commands.py @@ -111,6 +111,14 @@ class MochitestRunner(MozbuildObject): opts = mochitest.MochitestOptions(automation) options, args = opts.parse_args([]) + appname = '' + if sys.platform.startswith('darwin'): + appname = os.path.join(self.distdir, self.substs['MOZ_MACBUNDLE_NAME'], + 'Contents', 'MacOS', 'webapprt-stub' + automation.BIN_SUFFIX) + else: + appname = os.path.join(self.distdir, 'bin', 'webapprt-stub' + + automation.BIN_SUFFIX) + # Need to set the suite options before verifyOptions below. if suite == 'plain': # Don't need additional options for plain. @@ -124,6 +132,13 @@ class MochitestRunner(MozbuildObject): options.browserChrome = True elif suite == 'a11y': options.a11y = True + elif suite == 'webapprt-content': + options.webapprtContent = True + options.app = appname + elif suite == 'webapprt-chrome': + options.webapprtChrome = True + options.app = appname + options.browserArgs.append("-test-mode") else: raise Exception('None or unrecognized mochitest suite type.') @@ -227,7 +242,7 @@ def MochitestCommand(func): func = keep_open(func) rerun = CommandArgument('--rerun-failures', action='store_true', - help='Run only the tests that filed during the last test run.') + help='Run only the tests that failed during the last test run.') func = rerun(func) autorun = CommandArgument('--no-autorun', action='store_true', @@ -290,6 +305,18 @@ class MachCommands(MachCommandBase): def run_mochitest_a11y(self, test_file, **kwargs): return self.run_mochitest(test_file, 'a11y', **kwargs) + @Command('webapprt-test-chrome', category='testing', + description='Run a webapprt chrome mochitest.') + @MochitestCommand + def run_mochitest_webapprt_chrome(self, test_file, **kwargs): + return self.run_mochitest(test_file, 'webapprt-chrome', **kwargs) + + @Command('webapprt-test-content', category='testing', + description='Run a webapprt content mochitest.') + @MochitestCommand + def run_mochitest_webapprt_content(self, test_file, **kwargs): + return self.run_mochitest(test_file, 'webapprt-content', **kwargs) + def run_mochitest(self, test_file, flavor, **kwargs): self._ensure_state_subdir_exists('.') diff --git a/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js b/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js index c70f0f7dceff..4a065b26f605 100644 --- a/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js +++ b/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js @@ -872,6 +872,7 @@ let test_system_shutdown = maketest("system_shutdown", function system_shutdown( */ let test_duration = maketest("duration", function duration(test) { return Task.spawn(function() { + Services.prefs.setBoolPref("toolkit.osfile.log", true); // Options structure passed to a OS.File copy method. let copyOptions = { // This field should be overridden with the actual duration @@ -947,12 +948,12 @@ let test_duration = maketest("duration", function duration(test) { test.ok(copyOptions.outExecutionDuration >= backupDuration, "duration has increased 3"); OS.File.remove(pathDest); - Services.prefs.setBoolPref("toolkit.osfile.log", true); OS.Shared.TEST = true; // Testing an operation that doesn't take arguments at all let file = yield OS.File.open(pathSource); yield file.stat(); yield file.close(); + Services.prefs.setBoolPref("toolkit.osfile.log", false); }); }); diff --git a/toolkit/themes/windows/global/tree-aero.css b/toolkit/themes/windows/global/tree-aero.css index dd6b94228026..06029807acf7 100644 --- a/toolkit/themes/windows/global/tree-aero.css +++ b/toolkit/themes/windows/global/tree-aero.css @@ -70,7 +70,6 @@ treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(hover, open) { -moz-margin-start: 1px; -moz-margin-end: 1px; border-width: 2px; - border-style: solid !important; border-color: transparent; border-radius: 3px; background-repeat: no-repeat; @@ -89,6 +88,7 @@ treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(hover, open) { } treechildren::-moz-tree-row(current, focus) { + border-style: solid; -moz-border-top-colors: @hoverAndFocusBorderColor@ @whiteOpacityBorderColor@; -moz-border-right-colors: @hoverAndFocusBorderColor@ @whiteOpacityBorderColor@; -moz-border-left-colors: @hoverAndFocusBorderColor@ @whiteOpacityBorderColor@; @@ -107,6 +107,7 @@ treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(hover, open) { } treechildren::-moz-tree-row(selected, current, focus) { + border-style: solid; -moz-border-top-colors: @hoverAndFocusBorderColor@ @whiteOpacityBorderColor@; -moz-border-right-colors: @hoverAndFocusBorderColor@ @whiteOpacityBorderColor@; -moz-border-left-colors: @hoverAndFocusBorderColor@ @whiteOpacityBorderColor@; diff --git a/toolkit/themes/windows/global/tree.css b/toolkit/themes/windows/global/tree.css index c457af71b395..b0a33fd65f8c 100644 --- a/toolkit/themes/windows/global/tree.css +++ b/toolkit/themes/windows/global/tree.css @@ -61,6 +61,7 @@ tree[seltype="cell"] > treechildren::-moz-tree-row, tree[seltype="text"] > treechildren::-moz-tree-row { border: none; background-color: transparent; + background-image: none; } /* ::::: tree cells ::::: */