зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to inbound a=merge
--HG-- extra : commitid : IcbfYN5aCjt
This commit is contained in:
Коммит
e943bc8e33
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="cec4c1d3729137a24163756d15f98b0d37803966"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c3436122d678911d04b8f491724596116890ff9b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="cec4c1d3729137a24163756d15f98b0d37803966"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c3436122d678911d04b8f491724596116890ff9b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="cec4c1d3729137a24163756d15f98b0d37803966"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c3436122d678911d04b8f491724596116890ff9b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="cec4c1d3729137a24163756d15f98b0d37803966"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c3436122d678911d04b8f491724596116890ff9b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="aa5b7b7f6ed207ea1adc4df11d1d8bdaeabadd85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="638ec448619fda80fcb439b1747af62169d05548"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="cec4c1d3729137a24163756d15f98b0d37803966"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c3436122d678911d04b8f491724596116890ff9b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="cec4c1d3729137a24163756d15f98b0d37803966"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c3436122d678911d04b8f491724596116890ff9b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="cec4c1d3729137a24163756d15f98b0d37803966"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c3436122d678911d04b8f491724596116890ff9b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="4ace9aaee0e048dfda11bb787646c59982a3dc80"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="cec4c1d3729137a24163756d15f98b0d37803966"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c3436122d678911d04b8f491724596116890ff9b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"git": {
|
||||
"git_revision": "cec4c1d3729137a24163756d15f98b0d37803966",
|
||||
"git_revision": "c3436122d678911d04b8f491724596116890ff9b",
|
||||
"remote": "https://git.mozilla.org/releases/gaia.git",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "18c5a983482c343e6c08638eece0cdd6d336887e",
|
||||
"revision": "3024543d03a3106b3ec7cd7f0be4bb7cf56ff532",
|
||||
"repo_path": "integration/gaia-central"
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="cec4c1d3729137a24163756d15f98b0d37803966"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c3436122d678911d04b8f491724596116890ff9b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="cec4c1d3729137a24163756d15f98b0d37803966"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c3436122d678911d04b8f491724596116890ff9b"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="aa5b7b7f6ed207ea1adc4df11d1d8bdaeabadd85"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="638ec448619fda80fcb439b1747af62169d05548"/>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="cec4c1d3729137a24163756d15f98b0d37803966"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="c3436122d678911d04b8f491724596116890ff9b"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="956700d9754349b630a34551750ae6353614b6aa"/>
|
||||
|
|
|
@ -1324,6 +1324,21 @@ BrowserGlue.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
if (this._mayNeedToWarnAboutTabGroups) {
|
||||
let haveTabGroups = false;
|
||||
let wins = Services.wm.getEnumerator("navigator:browser");
|
||||
while (wins.hasMoreElements()) {
|
||||
let win = wins.getNext();
|
||||
if (win.TabView._tabBrowserHasHiddenTabs() && win.TabView.firstUseExperienced()) {
|
||||
haveTabGroups = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (haveTabGroups) {
|
||||
this._showTabGroupsDeprecationNotification();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef E10S_TESTING_ONLY
|
||||
E10SUINotification.checkStatus();
|
||||
#endif
|
||||
|
@ -1362,6 +1377,27 @@ BrowserGlue.prototype = {
|
|||
},
|
||||
#endif
|
||||
|
||||
_showTabGroupsDeprecationNotification() {
|
||||
let brandShortName = gBrandBundle.GetStringFromName("brandShortName");
|
||||
let text = gBrowserBundle.formatStringFromName("tabgroups.deprecationwarning.description",
|
||||
[brandShortName], 1);
|
||||
let learnMore = gBrowserBundle.GetStringFromName("tabgroups.deprecationwarning.learnMore.label");
|
||||
let learnMoreKey = gBrowserBundle.GetStringFromName("tabgroups.deprecationwarning.learnMore.accesskey");
|
||||
|
||||
let win = RecentWindow.getMostRecentBrowserWindow();
|
||||
let notifyBox = win.document.getElementById("high-priority-global-notificationbox");
|
||||
let button = {
|
||||
label: learnMore,
|
||||
accessKey: learnMoreKey,
|
||||
callback: function(aNotificationBar, aButton) {
|
||||
win.openUILinkIn("https://support.mozilla.org/kb/tab-groups-removal", "tab");
|
||||
},
|
||||
};
|
||||
|
||||
notifyBox.appendNotification(text, "tabgroups-removal-notification", null,
|
||||
notifyBox.PRIORITY_WARNING_MEDIUM, [button]);
|
||||
},
|
||||
|
||||
_onQuitRequest: function BG__onQuitRequest(aCancelQuit, aQuitType) {
|
||||
// If user has already dismissed quit request, then do nothing
|
||||
if ((aCancelQuit instanceof Ci.nsISupportsPRBool) && aCancelQuit.data)
|
||||
|
@ -1869,7 +1905,7 @@ BrowserGlue.prototype = {
|
|||
},
|
||||
|
||||
_migrateUI: function BG__migrateUI() {
|
||||
const UI_VERSION = 32;
|
||||
const UI_VERSION = 33;
|
||||
const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
|
||||
let currentUIVersion = 0;
|
||||
try {
|
||||
|
@ -2214,6 +2250,11 @@ BrowserGlue.prototype = {
|
|||
this._notifyNotificationsUpgrade().catch(Cu.reportError);
|
||||
}
|
||||
|
||||
if (currentUIVersion < 33) {
|
||||
// We'll do something once windows are open:
|
||||
this._mayNeedToWarnAboutTabGroups = true;
|
||||
}
|
||||
|
||||
// Update the migration version.
|
||||
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
|
||||
},
|
||||
|
@ -2240,7 +2281,10 @@ BrowserGlue.prototype = {
|
|||
let win = RecentWindow.getMostRecentBrowserWindow();
|
||||
win.openUILinkIn(data, "tab");
|
||||
}
|
||||
let imageURL = "chrome://browser/skin/web-notifications-icon.svg";
|
||||
// Show the application icon for XUL notifications. We assume system-level
|
||||
// notifications will include their own icon.
|
||||
let imageURL = this._hasSystemAlertsService() ? "" :
|
||||
"chrome://branding/content/about-logo.png";
|
||||
let title = gBrowserBundle.GetStringFromName("webNotifications.upgradeTitle");
|
||||
let text = gBrowserBundle.GetStringFromName("webNotifications.upgradeBody");
|
||||
let url = Services.urlFormatter.formatURLPref("browser.push.warning.migrationURL");
|
||||
|
@ -2249,6 +2293,14 @@ BrowserGlue.prototype = {
|
|||
true, url, clickCallback);
|
||||
}),
|
||||
|
||||
_hasSystemAlertsService: function() {
|
||||
try {
|
||||
return !!Cc["@mozilla.org/system-alerts-service;1"].getService(
|
||||
Ci.nsIAlertsService);
|
||||
} catch (e) {}
|
||||
return false;
|
||||
},
|
||||
|
||||
// ------------------------------
|
||||
// public nsIBrowserGlue members
|
||||
// ------------------------------
|
||||
|
|
|
@ -104,6 +104,7 @@ skip-if = e10s # Bug 1086190
|
|||
skip-if = buildapp == 'mulet'
|
||||
[browser_tabview_bug627736.js]
|
||||
[browser_tabview_bug628061.js]
|
||||
skip-if = true
|
||||
[browser_tabview_bug628165.js]
|
||||
[browser_tabview_bug628270.js]
|
||||
[browser_tabview_bug628887.js]
|
||||
|
|
|
@ -158,6 +158,8 @@ function test() {
|
|||
let onShow = function () {
|
||||
cw = win.TabView.getContentWindow();
|
||||
|
||||
cw.document.querySelector('.banner').remove();
|
||||
|
||||
let groupItem = cw.GroupItems.groupItems[0];
|
||||
groupItem.setSize(200, 200, true);
|
||||
groupItem.setUserSize();
|
||||
|
|
|
@ -32,12 +32,12 @@ function test() {
|
|||
|
||||
let assertNotificationBannerVisible = function (win) {
|
||||
let cw = win.TabView.getContentWindow();
|
||||
is(cw.iQ(".banner").length, 1, "notification banner is visible");
|
||||
is(cw.iQ(".banner").length, 2, "notification banner is visible");
|
||||
};
|
||||
|
||||
let assertNotificationBannerNotVisible = function (win) {
|
||||
let cw = win.TabView.getContentWindow();
|
||||
is(cw.iQ(".banner").length, 0, "notification banner is not visible");
|
||||
is(cw.iQ(".banner").length, 1, "notification banner is not visible");
|
||||
};
|
||||
|
||||
let next = function () {
|
||||
|
|
|
@ -511,6 +511,8 @@ var UI = {
|
|||
TabItems.resumePainting();
|
||||
}
|
||||
|
||||
this.notifyDeprecation();
|
||||
|
||||
if (gTabView.firstUseExperienced)
|
||||
gTabView.enableSessionRestore();
|
||||
},
|
||||
|
@ -522,6 +524,8 @@ var UI = {
|
|||
if (!this.isTabViewVisible() || this._isChangingVisibility)
|
||||
return;
|
||||
|
||||
iQ(".banner").remove();
|
||||
|
||||
// another tab might be select if user decides to stay on a page when
|
||||
// a onclose confirmation prompts.
|
||||
GroupItems.removeHiddenGroups();
|
||||
|
@ -1541,7 +1545,37 @@ var UI = {
|
|||
};
|
||||
|
||||
banner.animate({opacity: 0.7}, {duration: 1500, complete: onFadeIn});
|
||||
}
|
||||
},
|
||||
|
||||
// Function: notifyDeprecation
|
||||
// Notify the user that tab groups will be deprecated soon.
|
||||
notifyDeprecation() {
|
||||
let brandBundle = gWindow.document.getElementById("bundle_brand");
|
||||
let brandShortName = brandBundle.getString("brandShortName");
|
||||
let browserBundle = gWindow.document.getElementById("bundle_browser");
|
||||
let notificationText = browserBundle.getFormattedString(
|
||||
"tabgroups.deprecationwarning.description", [brandShortName]);
|
||||
|
||||
let learnMoreText = browserBundle.getString("tabgroups.deprecationwarning.learnMore.label");
|
||||
|
||||
let onButtonClick = () => {
|
||||
this.hideTabView();
|
||||
gWindow.openUILinkIn("https://support.mozilla.org/kb/tab-groups-removal", "tab");
|
||||
};
|
||||
|
||||
let button = iQ("<button>")
|
||||
.text(learnMoreText)
|
||||
.css('-moz-margin-start', '10px')
|
||||
.one('click', onButtonClick);
|
||||
|
||||
let banner = iQ("<div>")
|
||||
.text(notificationText)
|
||||
.addClass("banner")
|
||||
.append(button)
|
||||
.appendTo("body");
|
||||
|
||||
banner.animate({opacity: 0.7}, {duration: 1500});
|
||||
},
|
||||
};
|
||||
|
||||
// ----------
|
||||
|
|
|
@ -797,3 +797,9 @@ muteTab.label = Mute Tab
|
|||
muteTab.accesskey = M
|
||||
unmuteTab.label = Unmute Tab
|
||||
unmuteTab.accesskey = M
|
||||
|
||||
# LOCALIZATION NOTE (tabgroups.deprecationwarning.description):
|
||||
# %S is brandShortName
|
||||
tabgroups.deprecationwarning.description = Heads up! Tab Groups will be removed from %S soon.
|
||||
tabgroups.deprecationwarning.learnMore.label = Learn More
|
||||
tabgroups.deprecationwarning.learnMore.accesskey = L
|
||||
|
|
|
@ -564,7 +564,7 @@ html[dir=rtl] .iq-resizable-se {
|
|||
|
||||
#search{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: calc(100% - 1.7em - 20px); /* leave room for banner */
|
||||
}
|
||||
|
||||
#searchbox{
|
||||
|
|
|
@ -552,7 +552,7 @@ html[dir=rtl] .iq-resizable-se {
|
|||
|
||||
#search{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: calc(100% - 1.7em - 20px); /* leave room for banner */
|
||||
}
|
||||
|
||||
#searchbox {
|
||||
|
|
|
@ -569,7 +569,7 @@ html[dir=rtl] .iq-resizable-se {
|
|||
|
||||
#search{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: calc(100% - 1.7em - 20px); /* leave room for banner */
|
||||
}
|
||||
|
||||
#searchbox{
|
||||
|
|
|
@ -1441,7 +1441,7 @@ nsHTMLCopyEncoder::SetSelection(nsISelection* aSelection)
|
|||
}
|
||||
#ifdef MOZ_THUNDERBIRD
|
||||
else if (selContent->IsElement()) {
|
||||
nsRefPtr<nsStyleContext> styleContext =
|
||||
RefPtr<nsStyleContext> styleContext =
|
||||
nsComputedDOMStyle::GetStyleContextForElementNoFlush(
|
||||
selContent->AsElement(), nullptr, nullptr);
|
||||
if (styleContext) {
|
||||
|
|
|
@ -925,7 +925,7 @@ BluetoothPbapManager::ReplyToGet(uint16_t aPhonebookSize)
|
|||
// ---- Part 2b: [headerId:1][length:2][Body:var] ---- //
|
||||
index += AppendHeaderBody(&res[index],
|
||||
remainingPacketSize,
|
||||
(uint8_t*) buf.forget(),
|
||||
reinterpret_cast<uint8_t*>(buf.get()),
|
||||
numRead);
|
||||
|
||||
opcode = ObexResponseCode::Continue;
|
||||
|
|
|
@ -150,7 +150,12 @@ BrowserElementParent::DispatchOpenWindowEvent(Element* aOpenerFrameElement,
|
|||
|
||||
// Create the event's detail object.
|
||||
OpenWindowEventDetail detail;
|
||||
detail.mUrl = aURL;
|
||||
if (aURL.IsEmpty()) {
|
||||
// URL should never be empty. Assign about:blank as default.
|
||||
detail.mUrl = NS_LITERAL_STRING("about:blank");
|
||||
} else {
|
||||
detail.mUrl = aURL;
|
||||
}
|
||||
detail.mName = aName;
|
||||
detail.mFeatures = aFeatures;
|
||||
detail.mFrameElement = aPopupFrameElement;
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/* Any copyright is dedicated to the public domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Bug 1216937 - Test that window.open with null/empty URL should use
|
||||
// about:blank as default
|
||||
|
||||
"use strict";
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
browserElementTestHelpers.setEnabledPref(true);
|
||||
browserElementTestHelpers.addPermission();
|
||||
|
||||
function runTest() {
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.setAttribute('mozbrowser', 'true');
|
||||
|
||||
var gotPopup = false;
|
||||
iframe.addEventListener('mozbrowseropenwindow', function(e) {
|
||||
is(gotPopup, false, 'Should get just one popup.');
|
||||
gotPopup = true;
|
||||
|
||||
is(e.detail.url, 'about:blank', "Popup's has correct URL");
|
||||
e.preventDefault();
|
||||
|
||||
SimpleTest.finish();
|
||||
});
|
||||
|
||||
iframe.src = 'file_browserElement_OpenWindowEmpty.html';
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
|
||||
addEventListener('testready', runTest);
|
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
<body>
|
||||
<script>
|
||||
window.open();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -120,3 +120,5 @@ disabled = bug 924771
|
|||
[test_browserElement_oop_AudioChannel.html]
|
||||
[test_browserElement_oop_SetNFCFocus.html]
|
||||
[test_browserElement_oop_getWebManifest.html]
|
||||
[test_browserElement_oop_OpenWindowEmpty.html]
|
||||
skip-if = (toolkit == 'gonk') # Test doesn't work on B2G emulator
|
||||
|
|
|
@ -49,6 +49,7 @@ support-files =
|
|||
browserElement_OpenTab.js
|
||||
browserElement_OpenWindow.js
|
||||
browserElement_OpenWindowDifferentOrigin.js
|
||||
browserElement_OpenWindowEmpty.js
|
||||
browserElement_OpenWindowInFrame.js
|
||||
browserElement_OpenWindowRejected.js
|
||||
browserElement_Opensearch.js
|
||||
|
@ -105,6 +106,7 @@ support-files =
|
|||
file_browserElement_OpenNamed.html
|
||||
file_browserElement_OpenNamed2.html
|
||||
file_browserElement_OpenWindowDifferentOrigin.html
|
||||
file_browserElement_OpenWindowEmpty.html
|
||||
file_browserElement_OpenWindowInFrame.html
|
||||
file_browserElement_OpenWindowRejected.html
|
||||
file_browserElement_PrivateBrowsing.html
|
||||
|
@ -248,3 +250,5 @@ disabled = bug 774100
|
|||
[test_browserElement_inproc_AudioChannel.html]
|
||||
[test_browserElement_inproc_SetNFCFocus.html]
|
||||
[test_browserElement_inproc_getStructuredData.html]
|
||||
[test_browserElement_inproc_OpenWindowEmpty.html]
|
||||
skip-if = (toolkit == 'gonk') # Test doesn't work on B2G emulator
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for Bug 1216937</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="application/javascript;version=1.7" src="browserElement_OpenWindowEmpty.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for Bug 1216937</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="browserElementTestHelpers.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<script type="application/javascript;version=1.7" src="browserElement_OpenWindowEmpty.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -331,9 +331,9 @@ nsGonkCameraControl::ValidateConfiguration(const Configuration& aConfig, Configu
|
|||
}
|
||||
|
||||
if (mCurrentConfiguration.mMode == aConfig.mMode &&
|
||||
mRequestedPreviewSize.width == aConfig.mPreviewSize.width &&
|
||||
mRequestedPreviewSize.height == aConfig.mPreviewSize.height &&
|
||||
mCurrentConfiguration.mRecorderProfile.Equals(profile->GetName()))
|
||||
mCurrentConfiguration.mRecorderProfile.Equals(profile->GetName()) &&
|
||||
mRequestedPreviewSize.Equals(aConfig.mPreviewSize) &&
|
||||
mCurrentConfiguration.mPictureSize.Equals(aValidatedConfig.mPictureSize))
|
||||
{
|
||||
DOM_CAMERA_LOGI("Camera configuration is unchanged\n");
|
||||
return NS_ERROR_ALREADY_INITIALIZED;
|
||||
|
|
|
@ -116,6 +116,11 @@ public:
|
|||
struct Size {
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
|
||||
bool Equals(const Size& aSize) const
|
||||
{
|
||||
return width == aSize.width && height == aSize.height;
|
||||
}
|
||||
};
|
||||
|
||||
struct Region {
|
||||
|
|
|
@ -111,7 +111,7 @@ suite.test('picture-mode', function() {
|
|||
suite.hw.params['preview-size'] = '1x1';
|
||||
suite.hw.params['picture-size'] = '1x1';
|
||||
suite.hw.params['preview-size-values'] = '640x480,320x240,1x1';
|
||||
suite.hw.params['picture-size-values'] = '640x480,320x240,1x1';
|
||||
suite.hw.params['picture-size-values'] = '1280x960,640x480,320x240,1x1';
|
||||
suite.hw.params['video-size-values'] = '320x240';
|
||||
|
||||
var setConfig = {
|
||||
|
@ -123,6 +123,19 @@ suite.test('picture-mode', function() {
|
|||
};
|
||||
|
||||
var expConfig = {
|
||||
mode: 'picture',
|
||||
recorderProfile: 'qvga',
|
||||
previewSize: {
|
||||
width: 640,
|
||||
height: 480
|
||||
},
|
||||
pictureSize: {
|
||||
width: 1280,
|
||||
height: 960
|
||||
}
|
||||
};
|
||||
|
||||
var postConfig = {
|
||||
mode: 'picture',
|
||||
recorderProfile: 'qvga',
|
||||
previewSize: {
|
||||
|
@ -135,7 +148,47 @@ suite.test('picture-mode', function() {
|
|||
}
|
||||
};
|
||||
|
||||
return setAndVerifyConfig(setConfig, expConfig);
|
||||
function syncPreview() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
function onEvent(e) {
|
||||
if (e.newState === 'started') {
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
suite.camera.addEventListener('previewstatechange', onEvent);
|
||||
});
|
||||
}
|
||||
|
||||
function reconfigure(p) {
|
||||
// The preview restarting confirms the configuration actually happened
|
||||
var sync = new Promise(function(resolve, reject) {
|
||||
var i = 0;
|
||||
var expState = ['started', 'stopped', 'started'];
|
||||
|
||||
function onEvent(e) {
|
||||
ok(e.newState === expState[i], 'preview event state ' + expState[i] +
|
||||
' === ' + e.newState);
|
||||
++i;
|
||||
if (i === expState.length) { return; }
|
||||
suite.camera.removeEventListener('previewstatechange', onEvent);
|
||||
resolve();
|
||||
}
|
||||
|
||||
suite.camera.addEventListener('previewstatechange', onEvent);
|
||||
});
|
||||
|
||||
var configure = suite.camera.setConfiguration(postConfig)
|
||||
.then(resolveReconfigure);
|
||||
return Promise.all([sync, configure]);
|
||||
}
|
||||
|
||||
function resolveReconfigure(cfg) {
|
||||
verifyConfig(cfg, postConfig);
|
||||
}
|
||||
|
||||
return setAndVerifyConfig(setConfig, expConfig)
|
||||
.then(syncPreview)
|
||||
.then(reconfigure);
|
||||
});
|
||||
|
||||
suite.test('picture-mode-larger-picture-size', function() {
|
||||
|
|
|
@ -5742,6 +5742,18 @@ ContentParent::RecvGetDeviceStorageLocation(const nsString& aType,
|
|||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
ContentParent::RecvGetAndroidSystemInfo(AndroidSystemInfo* aInfo)
|
||||
{
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
nsSystemInfo::GetAndroidSystemInfo(aInfo);
|
||||
return true;
|
||||
#else
|
||||
MOZ_CRASH("wrong platform!");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
|
|
|
@ -943,6 +943,9 @@ private:
|
|||
|
||||
virtual bool RecvGetDeviceStorageLocation(const nsString& aType,
|
||||
nsString* aPath) override;
|
||||
|
||||
virtual bool RecvGetAndroidSystemInfo(AndroidSystemInfo* aInfo) override;
|
||||
|
||||
// If you add strong pointers to cycle collected objects here, be sure to
|
||||
// release these objects in ShutDownProcess. See the comment there for more
|
||||
// details.
|
||||
|
|
|
@ -423,6 +423,16 @@ struct FrameScriptInfo
|
|||
bool runInGlobalScope;
|
||||
};
|
||||
|
||||
struct AndroidSystemInfo
|
||||
{
|
||||
nsString device;
|
||||
nsString manufacturer;
|
||||
nsString release_version;
|
||||
nsString hardware;
|
||||
uint32_t sdk_version;
|
||||
bool isTablet;
|
||||
};
|
||||
|
||||
prio(normal upto urgent) sync protocol PContent
|
||||
{
|
||||
parent spawns PPluginModule;
|
||||
|
@ -1148,6 +1158,9 @@ parent:
|
|||
sync GetDeviceStorageLocation(nsString type)
|
||||
returns (nsString path);
|
||||
|
||||
sync GetAndroidSystemInfo()
|
||||
returns (AndroidSystemInfo info);
|
||||
|
||||
/**
|
||||
* Tells the parent to ungrab the pointer on the default display.
|
||||
*
|
||||
|
|
|
@ -150,7 +150,6 @@ skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' &
|
|||
[test_peerConnection_throwInCallbacks.html]
|
||||
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
|
||||
[test_peerConnection_toJSON.html]
|
||||
|
||||
[test_peerConnection_twoAudioStreams.html]
|
||||
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g (Bug 1059867), android(Bug 1189784, timeouts on 4.3 emulator)
|
||||
[test_peerConnection_twoAudioTracksInOneStream.html]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#Sun Oct 18 17:00:46 PDT 2015
|
||||
#Mon Nov 02 13:44:39 GMT 2015
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-all.zip
|
||||
|
|
|
@ -553,6 +553,12 @@ public class BrowserApp extends GeckoApp
|
|||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
if (!isSupportedSDK()) {
|
||||
// This build does not support the Android version of the device; Exit early.
|
||||
super.onCreate(savedInstanceState);
|
||||
return;
|
||||
}
|
||||
|
||||
final Intent intent = getIntent();
|
||||
|
||||
// Note that we're calling GeckoProfile.get *before GeckoApp.onCreate*.
|
||||
|
@ -1217,6 +1223,12 @@ public class BrowserApp extends GeckoApp
|
|||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (!isSupportedSDK()) {
|
||||
// This build does not support the Android version of the device; Exit early.
|
||||
super.onDestroy();
|
||||
return;
|
||||
}
|
||||
|
||||
mDynamicToolbar.destroy();
|
||||
|
||||
if (mBrowserToolbar != null)
|
||||
|
|
|
@ -64,6 +64,7 @@ import android.hardware.SensorEventListener;
|
|||
import android.location.Location;
|
||||
import android.location.LocationListener;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
|
@ -1220,6 +1221,14 @@ public abstract class GeckoApp
|
|||
enableStrictMode();
|
||||
}
|
||||
|
||||
if (!isSupportedSDK()) {
|
||||
// This build does not support the Android version of the device: Show an error and finish the app.
|
||||
super.onCreate(savedInstanceState);
|
||||
showSDKVersionError();
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
// The clock starts...now. Better hurry!
|
||||
mJavaUiStartupTimer = new Telemetry.UptimeTimer("FENNEC_STARTUP_TIME_JAVAUI");
|
||||
mGeckoReadyStartupTimer = new Telemetry.UptimeTimer("FENNEC_STARTUP_TIME_GECKOREADY");
|
||||
|
@ -2133,6 +2142,13 @@ public abstract class GeckoApp
|
|||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (!isSupportedSDK()) {
|
||||
// This build does not support the Android version of the device:
|
||||
// We did not initialize anything, so skip cleaning up.
|
||||
super.onDestroy();
|
||||
return;
|
||||
}
|
||||
|
||||
EventDispatcher.getInstance().unregisterGeckoThreadListener((GeckoEventListener)this,
|
||||
"Gecko:Ready",
|
||||
"Gecko:DelayedStartup",
|
||||
|
@ -2235,6 +2251,16 @@ public abstract class GeckoApp
|
|||
}
|
||||
}
|
||||
|
||||
protected boolean isSupportedSDK() {
|
||||
return Build.VERSION.SDK_INT >= Versions.MIN_SDK_VERSION &&
|
||||
Build.VERSION.SDK_INT <= Versions.MAX_SDK_VERSION;
|
||||
}
|
||||
|
||||
public void showSDKVersionError() {
|
||||
final String message = getString(R.string.unsupported_sdk_version, Build.CPU_ABI, Build.VERSION.SDK_INT);
|
||||
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
// Get a temporary directory, may return null
|
||||
public static File getTempDirectory() {
|
||||
File dir = GeckoApplication.get().getExternalFilesDir("temp");
|
||||
|
|
|
@ -9,6 +9,8 @@ android {
|
|||
defaultConfig {
|
||||
targetSdkVersion 22
|
||||
minSdkVersion 9
|
||||
// Used by Robolectric based tests; see TestRunner.
|
||||
buildConfigField 'String', 'BUILD_DIR', "\"${project.buildDir}\""
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
|
|
|
@ -748,3 +748,8 @@ just addresses the organization to follow, e.g. "This site is run by " -->
|
|||
<!ENTITY bookmarks_restricted_support2 "Firefox Help and Support for restricted profiles on Android tablets">
|
||||
<!-- LOCALIZATION NOTE (bookmarks_restricted_webmaker):link title for https://webmaker.org -->
|
||||
<!ENTITY bookmarks_restricted_webmaker "Learn the Web: Mozilla Webmaker">
|
||||
|
||||
<!-- LOCALIZATION NOTE (unsupported_sdk_version): The user installed a build of this app that does not support
|
||||
the Android version of this device. the formatS1 is replaced by the CPU ABI (e.g., ARMv7); the formatS2 is
|
||||
replaced by the Android OS version (e.g., 14)-->
|
||||
<!ENTITY unsupported_sdk_version "Sorry! This &brandShortName; won\'t work on this device (&formatS1;, &formatS2;). Please download the correct version.">
|
||||
|
|
|
@ -595,4 +595,6 @@
|
|||
<string name="intent_uri_private_browsing_multiple_match_title">&intent_uri_private_browsing_multiple_match_title;</string>
|
||||
|
||||
<string name="devtools_auth_scan_header">&devtools_auth_scan_header;</string>
|
||||
|
||||
<string name="unsupported_sdk_version">&unsupported_sdk_version;</string>
|
||||
</resources>
|
||||
|
|
|
@ -7,6 +7,8 @@ android {
|
|||
defaultConfig {
|
||||
targetSdkVersion 22
|
||||
minSdkVersion 9
|
||||
// Used by Robolectric based tests; see TestRunner.
|
||||
buildConfigField 'String', 'BUILD_DIR', "\"${project.buildDir}\""
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
|
|
|
@ -175,6 +175,8 @@ class ArtifactSubCommand(SubCommand):
|
|||
help='Firefox tree.'),
|
||||
CommandArgument('--job', metavar='JOB', choices=['android-api-11', 'android-x86'],
|
||||
help='Build job.'),
|
||||
CommandArgument('--verbose', '-v', action='store_true',
|
||||
help='Print verbose output.'),
|
||||
]
|
||||
for arg in args:
|
||||
after = arg(after)
|
||||
|
@ -207,9 +209,10 @@ class PackageFrontend(MachCommandBase):
|
|||
'''
|
||||
pass
|
||||
|
||||
def _make_artifacts(self, tree=None, job=None):
|
||||
self.log_manager.terminal_handler.setLevel(logging.INFO)
|
||||
def _set_log_level(self, verbose):
|
||||
self.log_manager.terminal_handler.setLevel(logging.INFO if not verbose else logging.DEBUG)
|
||||
|
||||
def _make_artifacts(self, tree=None, job=None):
|
||||
self._activate_virtualenv()
|
||||
self.virtualenv_manager.install_pip_package('pylru==1.0.9')
|
||||
self.virtualenv_manager.install_pip_package('taskcluster==0.0.16')
|
||||
|
@ -242,14 +245,16 @@ class PackageFrontend(MachCommandBase):
|
|||
'which case the current hg repository is inspected; an hg revision; '
|
||||
'a remote URL; or a local file.',
|
||||
default=None)
|
||||
def artifact_install(self, source=None, tree=None, job=None):
|
||||
def artifact_install(self, source=None, tree=None, job=None, verbose=False):
|
||||
self._set_log_level(verbose)
|
||||
tree, job = self._compute_defaults(tree, job)
|
||||
artifacts = self._make_artifacts(tree=tree, job=job)
|
||||
return artifacts.install_from(source, self.distdir)
|
||||
|
||||
@ArtifactSubCommand('artifact', 'last',
|
||||
'Print the last pre-built artifact installed.')
|
||||
def artifact_print_last(self, tree=None, job=None):
|
||||
def artifact_print_last(self, tree=None, job=None, verbose=False):
|
||||
self._set_log_level(verbose)
|
||||
tree, job = self._compute_defaults(tree, job)
|
||||
artifacts = self._make_artifacts(tree=tree, job=job)
|
||||
artifacts.print_last()
|
||||
|
@ -257,7 +262,8 @@ class PackageFrontend(MachCommandBase):
|
|||
|
||||
@ArtifactSubCommand('artifact', 'print-cache',
|
||||
'Print local artifact cache for debugging.')
|
||||
def artifact_print_cache(self, tree=None, job=None):
|
||||
def artifact_print_cache(self, tree=None, job=None, verbose=False):
|
||||
self._set_log_level(verbose)
|
||||
tree, job = self._compute_defaults(tree, job)
|
||||
artifacts = self._make_artifacts(tree=tree, job=job)
|
||||
artifacts.print_cache()
|
||||
|
@ -265,7 +271,8 @@ class PackageFrontend(MachCommandBase):
|
|||
|
||||
@ArtifactSubCommand('artifact', 'clear-cache',
|
||||
'Delete local artifacts and reset local artifact cache.')
|
||||
def artifact_clear_cache(self, tree=None, job=None):
|
||||
def artifact_clear_cache(self, tree=None, job=None, verbose=False):
|
||||
self._set_log_level(verbose)
|
||||
tree, job = self._compute_defaults(tree, job)
|
||||
artifacts = self._make_artifacts(tree=tree, job=job)
|
||||
artifacts.clear_cache()
|
||||
|
|
|
@ -3,14 +3,7 @@
|
|||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpResponse;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -18,21 +11,27 @@ import org.junit.runner.RunWith;
|
|||
import org.mozilla.android.sync.test.helpers.HTTPServerTestHelper;
|
||||
import org.mozilla.android.sync.test.helpers.MockServer;
|
||||
import org.mozilla.gecko.background.common.log.Logger;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.setup.auth.AuthenticateAccountStage;
|
||||
import org.mozilla.gecko.sync.setup.auth.AuthenticateAccountStage.AuthenticateAccountStageDelegate;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import org.simpleframework.http.Request;
|
||||
import org.simpleframework.http.Response;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
* Tests the authentication request stage of manual Account setup.
|
||||
* @author liuche
|
||||
*
|
||||
*/
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestAccountAuthenticatorStage {
|
||||
private static final int TEST_PORT = HTTPServerTestHelper.getTestPort();
|
||||
private static final String TEST_SERVER = "http://localhost:" + TEST_PORT;
|
||||
|
|
|
@ -3,27 +3,25 @@
|
|||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpResponse;
|
||||
import ch.boye.httpclientandroidlib.ProtocolVersion;
|
||||
import ch.boye.httpclientandroidlib.message.BasicHttpResponse;
|
||||
import ch.boye.httpclientandroidlib.message.BasicStatusLine;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.helpers.MockGlobalSessionCallback;
|
||||
import org.mozilla.gecko.background.testhelpers.MockGlobalSession;
|
||||
import org.mozilla.gecko.background.testhelpers.MockSharedPreferences;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.GlobalSession;
|
||||
import org.mozilla.gecko.sync.SyncConfiguration;
|
||||
import org.mozilla.gecko.sync.crypto.KeyBundle;
|
||||
import org.mozilla.gecko.sync.net.BasicAuthHeaderProvider;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpResponse;
|
||||
import ch.boye.httpclientandroidlib.ProtocolVersion;
|
||||
import ch.boye.httpclientandroidlib.message.BasicHttpResponse;
|
||||
import ch.boye.httpclientandroidlib.message.BasicStatusLine;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.mozilla.android.sync.test.helpers.MockGlobalSessionCallback;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestBackoff {
|
||||
private final String TEST_USERNAME = "johndoe";
|
||||
private final String TEST_PASSWORD = "password";
|
||||
|
|
|
@ -3,16 +3,15 @@
|
|||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import ch.boye.httpclientandroidlib.Header;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.net.BrowserIDAuthHeaderProvider;
|
||||
|
||||
import ch.boye.httpclientandroidlib.Header;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestBrowserIDAuthHeaderProvider {
|
||||
@Test
|
||||
public void testHeader() {
|
||||
|
|
|
@ -3,19 +3,7 @@
|
|||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpStatus;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
@ -32,6 +20,7 @@ import org.mozilla.gecko.background.testhelpers.MockClientsDataDelegate;
|
|||
import org.mozilla.gecko.background.testhelpers.MockClientsDatabaseAccessor;
|
||||
import org.mozilla.gecko.background.testhelpers.MockGlobalSession;
|
||||
import org.mozilla.gecko.background.testhelpers.MockSharedPreferences;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.CollectionKeys;
|
||||
import org.mozilla.gecko.sync.CommandProcessor.Command;
|
||||
|
@ -52,13 +41,23 @@ import org.mozilla.gecko.sync.net.SyncStorageResponse;
|
|||
import org.mozilla.gecko.sync.repositories.NullCursorException;
|
||||
import org.mozilla.gecko.sync.repositories.android.ClientsDatabaseAccessor;
|
||||
import org.mozilla.gecko.sync.repositories.domain.ClientRecord;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import org.simpleframework.http.Request;
|
||||
import org.simpleframework.http.Response;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpStatus;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestClientsEngineStage extends MockSyncClientsEngineStage {
|
||||
public final static String LOG_TAG = "TestClientsEngSta";
|
||||
|
||||
|
|
|
@ -3,27 +3,26 @@
|
|||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import ch.boye.httpclientandroidlib.Header;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.ExtendedJSONObject;
|
||||
import org.mozilla.gecko.sync.NonObjectJSONException;
|
||||
import org.mozilla.gecko.sync.Utils;
|
||||
import org.mozilla.gecko.sync.net.BasicAuthHeaderProvider;
|
||||
|
||||
import ch.boye.httpclientandroidlib.Header;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* Test the transfer of a UTF-8 string from desktop, and ensure that it results in the
|
||||
* correct hashed Basic Auth header.
|
||||
*/
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestCredentialsEndToEnd {
|
||||
|
||||
public static final String REAL_PASSWORD = "pïgéons1";
|
||||
|
|
|
@ -3,22 +3,11 @@
|
|||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpResponse;
|
||||
import ch.boye.httpclientandroidlib.ProtocolVersion;
|
||||
import ch.boye.httpclientandroidlib.message.BasicHttpResponse;
|
||||
import ch.boye.httpclientandroidlib.message.BasicStatusLine;
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -32,6 +21,7 @@ import org.mozilla.gecko.background.testhelpers.MockGlobalSession;
|
|||
import org.mozilla.gecko.background.testhelpers.MockPrefsGlobalSession;
|
||||
import org.mozilla.gecko.background.testhelpers.MockServerSyncStage;
|
||||
import org.mozilla.gecko.background.testhelpers.MockSharedPreferences;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.EngineSettings;
|
||||
import org.mozilla.gecko.sync.ExtendedJSONObject;
|
||||
|
@ -51,16 +41,24 @@ import org.mozilla.gecko.sync.stage.AndroidBrowserBookmarksServerSyncStage;
|
|||
import org.mozilla.gecko.sync.stage.GlobalSyncStage;
|
||||
import org.mozilla.gecko.sync.stage.GlobalSyncStage.Stage;
|
||||
import org.mozilla.gecko.sync.stage.NoSuchStageException;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import org.simpleframework.http.Request;
|
||||
import org.simpleframework.http.Response;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpResponse;
|
||||
import ch.boye.httpclientandroidlib.ProtocolVersion;
|
||||
import ch.boye.httpclientandroidlib.message.BasicHttpResponse;
|
||||
import ch.boye.httpclientandroidlib.message.BasicStatusLine;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestGlobalSession {
|
||||
private int TEST_PORT = HTTPServerTestHelper.getTestPort();
|
||||
private final String TEST_CLUSTER_URL = "http://localhost:" + TEST_PORT;
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.Utils;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestHeaderParsing {
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
|
|
|
@ -2,9 +2,20 @@
|
|||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.helpers.HTTPServerTestHelper;
|
||||
import org.mozilla.android.sync.test.helpers.MockServer;
|
||||
import org.mozilla.gecko.background.common.log.Logger;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.net.AuthHeaderProvider;
|
||||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageCollectionRequest;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageCollectionRequestDelegate;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageResponse;
|
||||
import org.simpleframework.http.Request;
|
||||
import org.simpleframework.http.Response;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
|
@ -12,21 +23,11 @@ import java.net.URI;
|
|||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.helpers.HTTPServerTestHelper;
|
||||
import org.mozilla.android.sync.test.helpers.MockServer;
|
||||
import org.mozilla.gecko.background.common.log.Logger;
|
||||
import org.mozilla.gecko.sync.net.AuthHeaderProvider;
|
||||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageCollectionRequest;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageCollectionRequestDelegate;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageResponse;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import org.simpleframework.http.Request;
|
||||
import org.simpleframework.http.Response;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestLineByLineHandling {
|
||||
private static final int TEST_PORT = HTTPServerTestHelper.getTestPort();
|
||||
private static final String TEST_SERVER = "http://localhost:" + TEST_PORT;
|
||||
|
|
|
@ -3,22 +3,13 @@
|
|||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.helpers.HTTPServerTestHelper;
|
||||
import org.mozilla.android.sync.test.helpers.MockServer;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.CryptoRecord;
|
||||
import org.mozilla.gecko.sync.ExtendedJSONObject;
|
||||
|
@ -27,11 +18,20 @@ import org.mozilla.gecko.sync.delegates.MetaGlobalDelegate;
|
|||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
import org.mozilla.gecko.sync.net.BasicAuthHeaderProvider;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageResponse;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import org.simpleframework.http.Request;
|
||||
import org.simpleframework.http.Response;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestMetaGlobal {
|
||||
public static Object monitor = new Object();
|
||||
|
||||
|
|
|
@ -3,28 +3,27 @@
|
|||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpResponse;
|
||||
import ch.boye.httpclientandroidlib.client.methods.HttpUriRequest;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.helpers.HTTPServerTestHelper;
|
||||
import org.mozilla.android.sync.test.helpers.MockResourceDelegate;
|
||||
import org.mozilla.android.sync.test.helpers.MockServer;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
import org.mozilla.gecko.sync.net.HttpResponseObserver;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpResponse;
|
||||
import ch.boye.httpclientandroidlib.client.methods.HttpUriRequest;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestResource {
|
||||
private static final int TEST_PORT = HTTPServerTestHelper.getTestPort();
|
||||
private static final String TEST_SERVER = "http://localhost:" + TEST_PORT;
|
||||
|
|
|
@ -1,22 +1,21 @@
|
|||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.sync.net.SyncResponse;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpResponse;
|
||||
import ch.boye.httpclientandroidlib.ProtocolVersion;
|
||||
import ch.boye.httpclientandroidlib.impl.cookie.DateUtils;
|
||||
import ch.boye.httpclientandroidlib.message.BasicHttpResponse;
|
||||
import ch.boye.httpclientandroidlib.message.BasicStatusLine;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.net.SyncResponse;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import java.util.Date;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestRetryAfter {
|
||||
private int TEST_SECONDS = 120;
|
||||
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.InfoCollections;
|
||||
import org.mozilla.gecko.sync.repositories.Server11Repository;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestServer11Repository {
|
||||
|
||||
private static final String COLLECTION = "bookmarks";
|
||||
|
|
|
@ -3,30 +3,30 @@
|
|||
|
||||
package org.mozilla.android.sync.net.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.helpers.BaseTestStorageRequestDelegate;
|
||||
import org.mozilla.android.sync.test.helpers.HTTPServerTestHelper;
|
||||
import org.mozilla.android.sync.test.helpers.MockServer;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.net.AuthHeaderProvider;
|
||||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
import org.mozilla.gecko.sync.net.BasicAuthHeaderProvider;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageRecordRequest;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageResponse;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import org.simpleframework.http.Request;
|
||||
import org.simpleframework.http.Response;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestSyncStorageRequest {
|
||||
private static final int TEST_PORT = HTTPServerTestHelper.getTestPort();
|
||||
private static final String TEST_SERVER = "http://localhost:" + TEST_PORT;
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import android.content.Context;
|
||||
import org.mozilla.gecko.background.common.log.Logger;
|
||||
import org.mozilla.gecko.background.testhelpers.WBORepository;
|
||||
import org.mozilla.gecko.sync.repositories.FetchFailedException;
|
||||
|
@ -19,7 +17,8 @@ import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionFetchRecor
|
|||
import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionFinishDelegate;
|
||||
import org.mozilla.gecko.sync.repositories.domain.Record;
|
||||
|
||||
import android.content.Context;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
public class SynchronizerHelpers {
|
||||
public static final String FAIL_SENTINEL = "Fail";
|
||||
|
|
|
@ -3,6 +3,23 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.apache.commons.codec.binary.Base64;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.CollectionKeys;
|
||||
import org.mozilla.gecko.sync.CryptoRecord;
|
||||
import org.mozilla.gecko.sync.NoCollectionKeysSetException;
|
||||
import org.mozilla.gecko.sync.NonObjectJSONException;
|
||||
import org.mozilla.gecko.sync.crypto.CryptoException;
|
||||
import org.mozilla.gecko.sync.crypto.KeyBundle;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
@ -10,24 +27,7 @@ import static org.junit.Assert.assertNotNull;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.apache.commons.codec.binary.Base64;
|
||||
import org.mozilla.gecko.sync.CollectionKeys;
|
||||
import org.mozilla.gecko.sync.CryptoRecord;
|
||||
import org.mozilla.gecko.sync.NoCollectionKeysSetException;
|
||||
import org.mozilla.gecko.sync.NonObjectJSONException;
|
||||
import org.mozilla.gecko.sync.crypto.CryptoException;
|
||||
import org.mozilla.gecko.sync.crypto.KeyBundle;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestCollectionKeys {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -3,27 +3,27 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.CommandProcessor;
|
||||
import org.mozilla.gecko.sync.CommandRunner;
|
||||
import org.mozilla.gecko.sync.ExtendedJSONObject;
|
||||
import org.mozilla.gecko.sync.GlobalSession;
|
||||
import org.mozilla.gecko.sync.NonObjectJSONException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.sync.CommandProcessor;
|
||||
import org.mozilla.gecko.sync.CommandRunner;
|
||||
import org.mozilla.gecko.sync.ExtendedJSONObject;
|
||||
import org.mozilla.gecko.sync.GlobalSession;
|
||||
import org.mozilla.gecko.sync.NonObjectJSONException;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestCommandProcessor extends CommandProcessor {
|
||||
|
||||
public static final String commandType = "displayURI";
|
||||
|
|
|
@ -3,21 +3,13 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.apache.commons.codec.binary.Base64;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.CryptoRecord;
|
||||
import org.mozilla.gecko.sync.ExtendedJSONObject;
|
||||
import org.mozilla.gecko.sync.NonObjectJSONException;
|
||||
|
@ -27,9 +19,17 @@ import org.mozilla.gecko.sync.crypto.KeyBundle;
|
|||
import org.mozilla.gecko.sync.repositories.domain.ClientRecord;
|
||||
import org.mozilla.gecko.sync.repositories.domain.HistoryRecord;
|
||||
import org.mozilla.gecko.sync.repositories.domain.Record;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestCryptoRecord {
|
||||
String base64EncryptionKey = "9K/wLdXdw+nrTtXo4ZpECyHFNr4d7aYHqeg3KW9+m6Q=";
|
||||
String base64HmacKey = "MMntEfutgLTc8FlTLQFms8/xMPmCldqPlq/QQXEjx70=";
|
||||
|
|
|
@ -1,20 +1,10 @@
|
|||
package org.mozilla.android.sync.test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.apache.commons.codec.binary.Base64;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.ExtendedJSONObject;
|
||||
import org.mozilla.gecko.sync.NonObjectJSONException;
|
||||
import org.mozilla.gecko.sync.crypto.CryptoException;
|
||||
|
@ -29,9 +19,19 @@ import org.mozilla.gecko.sync.jpake.JPakeParty;
|
|||
import org.mozilla.gecko.sync.jpake.stage.ComputeKeyVerificationStage;
|
||||
import org.mozilla.gecko.sync.jpake.stage.VerifyPairingStage;
|
||||
import org.mozilla.gecko.sync.setup.Constants;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestJPakeSetup {
|
||||
// Note: will throw NullPointerException if aborts. Only use stateless public
|
||||
// methods.
|
||||
|
|
|
@ -3,20 +3,13 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.db.Tab;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.CryptoRecord;
|
||||
import org.mozilla.gecko.sync.ExtendedJSONObject;
|
||||
import org.mozilla.gecko.sync.NonObjectJSONException;
|
||||
|
@ -26,9 +19,16 @@ import org.mozilla.gecko.sync.repositories.domain.HistoryRecord;
|
|||
import org.mozilla.gecko.sync.repositories.domain.Record;
|
||||
import org.mozilla.gecko.sync.repositories.domain.RecordParseException;
|
||||
import org.mozilla.gecko.sync.repositories.domain.TabsRecord;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestRecord {
|
||||
|
||||
@SuppressWarnings("static-method")
|
||||
|
|
|
@ -3,18 +3,12 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.SynchronizerHelpers.FailFetchWBORepository;
|
||||
import org.mozilla.android.sync.test.helpers.ExpectSuccessRepositorySessionCreationDelegate;
|
||||
import org.mozilla.android.sync.test.helpers.ExpectSuccessRepositorySessionFinishDelegate;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.background.testhelpers.WBORepository;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.repositories.InactiveSessionException;
|
||||
|
@ -25,9 +19,15 @@ import org.mozilla.gecko.sync.repositories.RepositorySessionBundle;
|
|||
import org.mozilla.gecko.sync.repositories.domain.BookmarkRecord;
|
||||
import org.mozilla.gecko.sync.synchronizer.RecordsChannel;
|
||||
import org.mozilla.gecko.sync.synchronizer.RecordsChannelDelegate;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestRecordsChannel {
|
||||
|
||||
protected WBORepository remote;
|
||||
|
|
|
@ -3,12 +3,7 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -17,6 +12,7 @@ import org.mozilla.gecko.background.testhelpers.DefaultGlobalSessionCallback;
|
|||
import org.mozilla.gecko.background.testhelpers.MockPrefsGlobalSession;
|
||||
import org.mozilla.gecko.background.testhelpers.MockServerSyncStage;
|
||||
import org.mozilla.gecko.background.testhelpers.MockSharedPreferences;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.CommandProcessor;
|
||||
import org.mozilla.gecko.sync.EngineSettings;
|
||||
|
@ -33,13 +29,16 @@ import org.mozilla.gecko.sync.net.BasicAuthHeaderProvider;
|
|||
import org.mozilla.gecko.sync.stage.GlobalSyncStage;
|
||||
import org.mozilla.gecko.sync.stage.GlobalSyncStage.Stage;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Test that reset commands properly invoke the reset methods on the correct stage.
|
||||
*/
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestResetCommands {
|
||||
private static final String TEST_USERNAME = "johndoe";
|
||||
private static final String TEST_PASSWORD = "password";
|
||||
|
|
|
@ -3,15 +3,7 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpEntity;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.SynchronizerHelpers.TrackingWBORepository;
|
||||
|
@ -19,6 +11,7 @@ import org.mozilla.android.sync.test.helpers.BaseTestStorageRequestDelegate;
|
|||
import org.mozilla.android.sync.test.helpers.HTTPServerTestHelper;
|
||||
import org.mozilla.android.sync.test.helpers.MockServer;
|
||||
import org.mozilla.gecko.background.testhelpers.MockRecord;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.InfoCollections;
|
||||
import org.mozilla.gecko.sync.JSONRecordFetcher;
|
||||
|
@ -43,14 +36,20 @@ import org.mozilla.gecko.sync.repositories.domain.Record;
|
|||
import org.mozilla.gecko.sync.stage.SafeConstrainedServer11Repository;
|
||||
import org.mozilla.gecko.sync.synchronizer.ServerLocalSynchronizer;
|
||||
import org.mozilla.gecko.sync.synchronizer.Synchronizer;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import org.simpleframework.http.ContentType;
|
||||
import org.simpleframework.http.Request;
|
||||
import org.simpleframework.http.Response;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpEntity;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestServer11RepositorySession {
|
||||
|
||||
public class POSTMockServer extends MockServer {
|
||||
|
|
|
@ -3,12 +3,6 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.SynchronizerHelpers.BatchFailStoreWBORepository;
|
||||
|
@ -20,6 +14,7 @@ import org.mozilla.android.sync.test.SynchronizerHelpers.FinishFailedException;
|
|||
import org.mozilla.android.sync.test.SynchronizerHelpers.SerialFailStoreWBORepository;
|
||||
import org.mozilla.android.sync.test.SynchronizerHelpers.TrackingWBORepository;
|
||||
import org.mozilla.gecko.background.common.log.Logger;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.background.testhelpers.WBORepository;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.repositories.FetchFailedException;
|
||||
|
@ -28,9 +23,14 @@ import org.mozilla.gecko.sync.repositories.domain.BookmarkRecord;
|
|||
import org.mozilla.gecko.sync.synchronizer.ServerLocalSynchronizer;
|
||||
import org.mozilla.gecko.sync.synchronizer.Synchronizer;
|
||||
import org.mozilla.gecko.sync.synchronizer.SynchronizerDelegate;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestServerLocalSynchronizer {
|
||||
public static final String LOG_TAG = "TestServLocSync";
|
||||
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.testhelpers.MockSharedPreferences;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.Sync11Configuration;
|
||||
import org.mozilla.gecko.sync.SyncConfiguration;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import java.net.URI;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestSyncConfiguration {
|
||||
@Test
|
||||
public void testURLs() throws Exception {
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.setup.InvalidSyncKeyException;
|
||||
import org.mozilla.gecko.sync.setup.activities.ActivityUtils;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestSyncKeyVerification {
|
||||
|
||||
private int[] mutateIndices;
|
||||
|
|
|
@ -3,21 +3,14 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import android.content.Context;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.SynchronizerHelpers.TrackingWBORepository;
|
||||
import org.mozilla.gecko.background.common.log.Logger;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.background.testhelpers.WBORepository;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.repositories.RepositorySessionBundle;
|
||||
|
@ -27,10 +20,16 @@ import org.mozilla.gecko.sync.synchronizer.SynchronizerDelegate;
|
|||
import org.mozilla.gecko.sync.synchronizer.SynchronizerSession;
|
||||
import org.mozilla.gecko.sync.synchronizer.SynchronizerSessionDelegate;
|
||||
|
||||
import android.content.Context;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import java.util.Date;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestSynchronizer {
|
||||
public static final String LOG_TAG = "TestSynchronizer";
|
||||
|
||||
|
|
|
@ -3,23 +3,14 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import android.content.Context;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.SynchronizerHelpers.DataAvailableWBORepository;
|
||||
import org.mozilla.android.sync.test.SynchronizerHelpers.ShouldSkipWBORepository;
|
||||
import org.mozilla.gecko.background.common.log.Logger;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.background.testhelpers.WBORepository;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.SynchronizerConfiguration;
|
||||
|
@ -30,10 +21,18 @@ import org.mozilla.gecko.sync.synchronizer.Synchronizer;
|
|||
import org.mozilla.gecko.sync.synchronizer.SynchronizerSession;
|
||||
import org.mozilla.gecko.sync.synchronizer.SynchronizerSessionDelegate;
|
||||
|
||||
import android.content.Context;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestSynchronizerSession {
|
||||
public static final String LOG_TAG = TestSynchronizerSession.class.getSimpleName();
|
||||
|
||||
|
|
|
@ -3,22 +3,22 @@
|
|||
|
||||
package org.mozilla.android.sync.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.SyncConstants;
|
||||
import org.mozilla.gecko.sync.Utils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.sync.SyncConstants;
|
||||
import org.mozilla.gecko.sync.Utils;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestUtils extends Utils {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.mozilla.gecko.sync.net.AuthHeaderProvider;
|
||||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
import org.mozilla.gecko.sync.net.BasicAuthHeaderProvider;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageRequestDelegate;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
public class BaseTestStorageRequestDelegate implements
|
||||
SyncStorageRequestDelegate {
|
||||
|
||||
|
|
|
@ -3,14 +3,13 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.repositories.RepositorySession;
|
||||
import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionBeginDelegate;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
public class ExpectSuccessRepositorySessionBeginDelegate
|
||||
extends ExpectSuccessDelegate
|
||||
implements RepositorySessionBeginDelegate {
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.repositories.RepositorySession;
|
||||
import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionCreationDelegate;
|
||||
|
|
|
@ -3,15 +3,14 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionFetchRecordsDelegate;
|
||||
import org.mozilla.gecko.sync.repositories.domain.Record;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
public class ExpectSuccessRepositorySessionFetchRecordsDelegate extends
|
||||
ExpectSuccessDelegate implements RepositorySessionFetchRecordsDelegate {
|
||||
public ArrayList<Record> fetchedRecords = new ArrayList<Record>();
|
||||
|
|
|
@ -3,15 +3,14 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.repositories.RepositorySession;
|
||||
import org.mozilla.gecko.sync.repositories.RepositorySessionBundle;
|
||||
import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionFinishDelegate;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
public class ExpectSuccessRepositorySessionFinishDelegate extends
|
||||
ExpectSuccessDelegate implements RepositorySessionFinishDelegate {
|
||||
|
||||
|
|
|
@ -3,13 +3,12 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionStoreDelegate;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
public class ExpectSuccessRepositorySessionStoreDelegate extends
|
||||
ExpectSuccessDelegate implements RepositorySessionStoreDelegate {
|
||||
|
||||
|
|
|
@ -3,13 +3,12 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.repositories.delegates.RepositorySessionWipeDelegate;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
public class ExpectSuccessRepositoryWipeDelegate extends ExpectSuccessDelegate
|
||||
implements RepositorySessionWipeDelegate {
|
||||
|
||||
|
|
|
@ -3,7 +3,11 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
import org.mozilla.gecko.background.common.log.Logger;
|
||||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
import org.mozilla.gecko.sync.net.BaseResourceDelegate;
|
||||
import org.simpleframework.transport.connect.Connection;
|
||||
import org.simpleframework.transport.connect.SocketConnection;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
|
@ -11,11 +15,7 @@ import java.net.SocketAddress;
|
|||
import java.util.IdentityHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.mozilla.gecko.background.common.log.Logger;
|
||||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
import org.mozilla.gecko.sync.net.BaseResourceDelegate;
|
||||
import org.simpleframework.transport.connect.Connection;
|
||||
import org.simpleframework.transport.connect.SocketConnection;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
* Test helper code to bind <code>MockServer</code> instances to ports.
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.GlobalSession;
|
||||
import org.mozilla.gecko.sync.delegates.GlobalSessionCallback;
|
||||
import org.mozilla.gecko.sync.stage.GlobalSyncStage.Stage;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* A callback for use with a GlobalSession that records what happens for later
|
||||
* inspection.
|
||||
|
|
|
@ -3,21 +3,20 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.GeneralSecurityException;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpResponse;
|
||||
import ch.boye.httpclientandroidlib.client.ClientProtocolException;
|
||||
import ch.boye.httpclientandroidlib.client.methods.HttpRequestBase;
|
||||
import ch.boye.httpclientandroidlib.impl.client.DefaultHttpClient;
|
||||
import org.mozilla.gecko.background.testhelpers.WaitHelper;
|
||||
import org.mozilla.gecko.sync.net.AuthHeaderProvider;
|
||||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
import org.mozilla.gecko.sync.net.BasicAuthHeaderProvider;
|
||||
import org.mozilla.gecko.sync.net.ResourceDelegate;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpResponse;
|
||||
import ch.boye.httpclientandroidlib.client.ClientProtocolException;
|
||||
import ch.boye.httpclientandroidlib.client.methods.HttpRequestBase;
|
||||
import ch.boye.httpclientandroidlib.impl.client.DefaultHttpClient;
|
||||
import java.io.IOException;
|
||||
import java.security.GeneralSecurityException;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class MockResourceDelegate implements ResourceDelegate {
|
||||
public WaitHelper waitHelper = null;
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
|
||||
import org.mozilla.gecko.background.common.log.Logger;
|
||||
import org.mozilla.gecko.sync.Utils;
|
||||
import org.simpleframework.http.Request;
|
||||
import org.simpleframework.http.Response;
|
||||
import org.simpleframework.http.core.Container;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class MockServer implements Container {
|
||||
public static final String LOG_TAG = "MockServer";
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
import org.mozilla.gecko.sync.net.SyncStorageResponse;
|
||||
import org.mozilla.gecko.sync.stage.SyncClientsEngineStage;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class MockSyncClientsEngineStage extends SyncClientsEngineStage {
|
||||
public class MockClientUploadDelegate extends ClientUploadDelegate {
|
||||
HTTPServerTestHelper data;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.mozilla.android.sync.test.helpers;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.simpleframework.http.Path;
|
||||
import org.simpleframework.http.Request;
|
||||
import org.simpleframework.http.Response;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* A trivial server that collects and returns WBOs.
|
||||
*
|
||||
|
|
|
@ -3,23 +3,23 @@
|
|||
|
||||
package org.mozilla.android.sync.test.helpers.test;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.helpers.HTTPServerTestHelper;
|
||||
import org.mozilla.android.sync.test.helpers.HTTPServerTestHelper.HTTPServerAlreadyRunningError;
|
||||
import org.mozilla.android.sync.test.helpers.MockServer;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.android.sync.test.helpers.HTTPServerTestHelper;
|
||||
import org.mozilla.android.sync.test.helpers.MockServer;
|
||||
import org.mozilla.android.sync.test.helpers.HTTPServerTestHelper.HTTPServerAlreadyRunningError;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestHTTPServerTestHelper {
|
||||
public static final int TEST_PORT = HTTPServerTestHelper.getTestPort();
|
||||
|
||||
|
|
|
@ -3,14 +3,7 @@
|
|||
|
||||
package org.mozilla.gecko.background.common.log.writers.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
import android.util.Log;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -22,11 +15,17 @@ import org.mozilla.gecko.background.common.log.writers.PrintLogWriter;
|
|||
import org.mozilla.gecko.background.common.log.writers.SimpleTagLogWriter;
|
||||
import org.mozilla.gecko.background.common.log.writers.StringLogWriter;
|
||||
import org.mozilla.gecko.background.common.log.writers.ThreadLocalTagLogWriter;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
|
||||
import android.util.Log;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestLogWriters {
|
||||
|
||||
public static final String TEST_LOG_TAG_1 = "TestLogTag1";
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
|
||||
package org.mozilla.gecko.background.fxa.test;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.fxa.FxAccountAgeLockoutHelper;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.fxa.FxAccountConstants;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import java.util.Calendar;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestFxAccountAgeLockoutHelper {
|
||||
@Test
|
||||
public void testPassesAgeCheck() {
|
||||
|
|
|
@ -3,20 +3,19 @@
|
|||
|
||||
package org.mozilla.gecko.background.fxa.test;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.fxa.FxAccountClient20;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.fxa.FxAccountClient20;
|
||||
import org.mozilla.gecko.sync.net.BaseResource;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestFxAccountClient20 {
|
||||
protected static class MockFxAccountClient20 extends FxAccountClient20 {
|
||||
public MockFxAccountClient20(String serverURI, Executor executor) {
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
|
||||
package org.mozilla.gecko.background.fxa.test;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.apache.commons.codec.binary.Base64;
|
||||
import org.mozilla.gecko.background.fxa.FxAccountUtils;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.Utils;
|
||||
import org.mozilla.gecko.sync.crypto.KeyBundle;
|
||||
import org.mozilla.gecko.sync.net.SRPConstants;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* Test vectors from
|
||||
|
@ -21,7 +21,7 @@ import org.robolectric.RobolectricGradleTestRunner;
|
|||
* and
|
||||
* <a href="https://github.com/mozilla/fxa-auth-server/wiki/onepw-protocol/5a9bc81e499306d769ca19b40b50fa60123df15d">https://github.com/mozilla/fxa-auth-server/wiki/onepw-protocol/5a9bc81e499306d769ca19b40b50fa60123df15d</a>.
|
||||
*/
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestFxAccountUtils {
|
||||
protected static void assertEncoding(String base16String, String utf8String) throws Exception {
|
||||
Assert.assertEquals(base16String, FxAccountUtils.bytes(utf8String));
|
||||
|
|
|
@ -3,10 +3,7 @@
|
|||
|
||||
package org.mozilla.gecko.background.healthreport.prune.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -14,11 +11,13 @@ import org.mozilla.gecko.background.healthreport.HealthReportConstants;
|
|||
import org.mozilla.gecko.background.healthreport.prune.PrunePolicy;
|
||||
import org.mozilla.gecko.background.healthreport.prune.PrunePolicyStorage;
|
||||
import org.mozilla.gecko.background.testhelpers.MockSharedPreferences;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestPrunePolicy {
|
||||
public static class MockPrunePolicy extends PrunePolicy {
|
||||
public MockPrunePolicy(final PrunePolicyStorage storage, final SharedPreferences sharedPrefs) {
|
||||
|
|
|
@ -3,11 +3,9 @@
|
|||
|
||||
package org.mozilla.gecko.background.healthreport.test;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.database.Cursor;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import org.json.JSONObject;
|
||||
import org.mozilla.gecko.background.healthreport.Environment;
|
||||
import org.mozilla.gecko.background.healthreport.HealthReportStorage;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ package org.mozilla.gecko.background.healthreport.upload.test;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import org.mozilla.gecko.background.healthreport.Environment;
|
||||
import org.mozilla.gecko.background.healthreport.Environment.UIType;
|
||||
import org.mozilla.gecko.background.healthreport.EnvironmentBuilder.ConfigurationProvider;
|
||||
|
|
|
@ -3,8 +3,15 @@
|
|||
|
||||
package org.mozilla.gecko.background.healthreport.upload.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import android.content.SharedPreferences;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.healthreport.HealthReportConstants;
|
||||
import org.mozilla.gecko.background.healthreport.upload.ObsoleteDocumentTracker;
|
||||
import org.mozilla.gecko.background.testhelpers.MockSharedPreferences;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.ExtendedJSONObject;
|
||||
|
||||
import java.util.AbstractMap.SimpleImmutableEntry;
|
||||
import java.util.ArrayList;
|
||||
|
@ -15,18 +22,10 @@ import java.util.List;
|
|||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.healthreport.HealthReportConstants;
|
||||
import org.mozilla.gecko.background.healthreport.upload.ObsoleteDocumentTracker;
|
||||
import org.mozilla.gecko.background.testhelpers.MockSharedPreferences;
|
||||
import org.mozilla.gecko.sync.ExtendedJSONObject;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestObsoleteDocumentTracker {
|
||||
public static class MockObsoleteDocumentTracker extends ObsoleteDocumentTracker {
|
||||
public MockObsoleteDocumentTracker(SharedPreferences sharedPrefs) {
|
||||
|
|
|
@ -3,15 +3,7 @@
|
|||
|
||||
package org.mozilla.gecko.background.healthreport.upload.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -21,12 +13,19 @@ import org.mozilla.gecko.background.healthreport.upload.SubmissionPolicy;
|
|||
import org.mozilla.gecko.background.healthreport.upload.test.TestObsoleteDocumentTracker.MockObsoleteDocumentTracker;
|
||||
import org.mozilla.gecko.background.healthreport.upload.test.TestSubmissionPolicy.MockSubmissionClient.Response;
|
||||
import org.mozilla.gecko.background.testhelpers.MockSharedPreferences;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
import org.mozilla.gecko.sync.ExtendedJSONObject;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestSubmissionPolicy {
|
||||
public static class MockSubmissionClient implements SubmissionClient {
|
||||
public String lastId = null;
|
||||
|
|
|
@ -3,23 +3,21 @@
|
|||
|
||||
package org.mozilla.gecko.background.healthreport.upload.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.healthreport.upload.AndroidSubmissionClient.SubmissionsFieldName;
|
||||
import org.mozilla.gecko.background.healthreport.upload.test.MockAndroidSubmissionClient.MockHealthReportStorage;
|
||||
import org.mozilla.gecko.background.healthreport.upload.test.MockAndroidSubmissionClient.MockSubmissionsTracker;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.healthreport.upload.AndroidSubmissionClient.SubmissionsFieldName;
|
||||
import org.mozilla.gecko.background.healthreport.upload.test.MockAndroidSubmissionClient;
|
||||
import org.mozilla.gecko.background.healthreport.upload.test.MockAndroidSubmissionClient.MockHealthReportStorage;
|
||||
import org.mozilla.gecko.background.healthreport.upload.test.MockAndroidSubmissionClient.MockSubmissionsTracker;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestSubmissionsTracker {
|
||||
protected static class MockHealthReportStorage2 extends MockHealthReportStorage {
|
||||
public final int FIRST_ATTEMPT_ID = SubmissionsFieldName.FIRST_ATTEMPT.getID(this);
|
||||
|
|
|
@ -3,25 +3,23 @@
|
|||
|
||||
package org.mozilla.gecko.background.healthreport.upload.test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.healthreport.HealthReportStorage;
|
||||
import org.mozilla.gecko.background.healthreport.upload.AndroidSubmissionClient.SubmissionsTracker.TrackingRequestDelegate;
|
||||
import org.mozilla.gecko.background.healthreport.upload.test.MockAndroidSubmissionClient.MockHealthReportStorage;
|
||||
import org.mozilla.gecko.background.testhelpers.StubDelegate;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.healthreport.HealthReportStorage;
|
||||
import org.mozilla.gecko.background.healthreport.upload.AndroidSubmissionClient.SubmissionsTracker.TrackingRequestDelegate;
|
||||
import org.mozilla.gecko.background.healthreport.upload.test.MockAndroidSubmissionClient;
|
||||
import org.mozilla.gecko.background.healthreport.upload.test.MockAndroidSubmissionClient.MockHealthReportStorage;
|
||||
import org.mozilla.gecko.background.testhelpers.StubDelegate;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestTrackingRequestDelegate {
|
||||
public static class MockAndroidSubmissionClient2 extends MockAndroidSubmissionClient {
|
||||
public MockAndroidSubmissionClient2() {
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
package org.mozilla.gecko.background.test;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpEntity;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpEntity;
|
||||
|
||||
public class EntityTestHelper {
|
||||
private static final int DEFAULT_SIZE = 1024;
|
||||
|
||||
|
|
|
@ -3,18 +3,17 @@
|
|||
|
||||
package org.mozilla.gecko.background.test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpEntity;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mozilla.gecko.background.bagheera.BoundedByteArrayEntity;
|
||||
import org.mozilla.gecko.background.testhelpers.TestRunner;
|
||||
|
||||
import ch.boye.httpclientandroidlib.HttpEntity;
|
||||
import org.robolectric.RobolectricGradleTestRunner;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
@RunWith(RobolectricGradleTestRunner.class)
|
||||
@RunWith(TestRunner.class)
|
||||
public class TestBoundedByteArrayEntity {
|
||||
private static void expectFail(byte[] input, int start, int end) {
|
||||
try {
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче