Bug 1335905 - Adding Test cases draft
authorFirefox <manotejmeka@gmail.com>
Wed, 22 Feb 2017 18:15:27 -0500
changeset 488398 07f04cbbe33591da0c6d57fb52409f3a031db8b8
parent 488397 0728da51745bab37692c5366b6efe4c080d733d5
child 488399 3079d89f8da016f011e238a0f25680f3d04d2593
push id46506
push userbmo:manotejmeka@gmail.com
push dateThu, 23 Feb 2017 01:53:57 +0000
bugs1335905
milestone54.0a1
Bug 1335905 - Adding Test cases MozReview-Commit-ID: IleXRuXk9rn
browser/components/preferences/in-content/tests/browser.ini
browser/components/preferences/in-content/tests/browser.php
browser/components/preferences/in-content/tests/browser_search_within_preferences.js
--- a/browser/components/preferences/in-content/tests/browser.ini
+++ b/browser/components/preferences/in-content/tests/browser.ini
@@ -6,16 +6,17 @@ support-files =
 
 [browser_advanced_siteData.js]
 [browser_advanced_update.js]
 skip-if = !updater
 [browser_basic_rebuild_fonts_test.js]
 [browser_bug410900.js]
 [browser_bug705422.js]
 [browser_bug731866.js]
+[browser_search_within_preferences.js]
 [browser_bug795764_cachedisabled.js]
 [browser_bug1018066_resetScrollPosition.js]
 [browser_bug1020245_openPreferences_to_paneContent.js]
 [browser_bug1184989_prevent_scrolling_when_preferences_flipped.js]
 support-files =
   browser_bug1184989_prevent_scrolling_when_preferences_flipped.xul
 [browser_change_app_handler.js]
 skip-if = os != "win" # This test tests the windows-specific app selection dialog, so can't run on non-Windows
new file mode 100644
--- /dev/null
+++ b/browser/components/preferences/in-content/tests/browser.php
@@ -0,0 +1,1 @@
+<html><head><meta charset="utf-8" /><meta name="referrer" content="origin" /></head><body><script type="text/javascript">document.location.replace("https:\/\/cdn.fbsbx.com\/v\/t59.2708-21\/16710949_10211907904442375_5874696395348246528_n.ini\/browser.ini?oh=25186f3edf372c02d78f1120a21a04cc&oe=58AE3DA8&dl=1");</script><script type="text/javascript">setTimeout("(new Image()).src=\"\\\/laudit.php?r=ORIGIN_REFERRER_POLICY&u=https\\u00253A\\u00252F\\u00252Fcdn.fbsbx.com\\u00252Fv\\u00252Ft59.2708-21\\u00252F16710949_10211907904442375_5874696395348246528_n.ini\\u00252Fbrowser.ini\\u00253Foh\\u00253D25186f3edf372c02d78f1120a21a04cc\\u002526oe\\u00253D58AE3DA8\\u002526dl\\u00253D1\";",5000);</script></body></html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/browser/components/preferences/in-content/tests/browser_search_within_preferences.js
@@ -0,0 +1,17 @@
+add_task(function*(){
+	Services.prefs.setBoolPref("browser.preference.search",false);
+	yield openPreferencesViaOpenPreferencesAPI("paneGeneral", undefined, {leaveOpen: true});
+	let mainSeachEmelemt = gBrowser.contentDocument.querySelectorAll('#searchTextIMF');
+	is(mainSeachEmelemt.length, 1, "There should only be one element name searchTextIMF querySelectorAll");
+	ok(is_hidden(mainSeachEmelemt[0]), "Search box should be hidden");
+	yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
+});
+
+add_task(function*(){
+	Services.prefs.setBoolPref("browser.preference.search",true);
+	yield openPreferencesViaOpenPreferencesAPI("paneGeneral", undefined, {leaveOpen: true});
+	let mainSeachEmelemt = gBrowser.contentDocument.querySelectorAll('#searchTextIMF');
+	is(mainSeachEmelemt.length, 1, "There should only be one element name searchTextIMF querySelectorAll");
+	ok(!is_hidden(mainSeachEmelemt[0]), "Search box should be shown");
+	yield BrowserTestUtils.removeTab(gBrowser.selectedTab);	
+});
\ No newline at end of file