unit: Add tests for BrowserOnly Key

test-pacrunner and suites have been fixed to test BrowserOnly key
and it's function.
diff --git a/unit/suite/manual_basic.test b/unit/suite/manual_basic.test
index 4406d9c..ed0d7f8 100644
--- a/unit/suite/manual_basic.test
+++ b/unit/suite/manual_basic.test
@@ -10,6 +10,9 @@
 
 [excludes]
 
+[browseronly]
+FALSE
+
 [domains]
 
 [config]
@@ -24,3 +27,13 @@
 PROXY secproxy.internal.com; PROXY proxy.internal.com; SOCKS4 sockproxy.internal.com
 socks4://sockaccess.external.net:8888/sock_script sockaccess.external.net
 SOCKS4 sockproxy.internal.com; PROXY proxy.internal.com; PROXY secproxy.internal.com
+smtp://mail.client.com/drafts mail.client.com
+PROXY proxy.internal.com; PROXY secproxy.internal.com; SOCKS4 sockproxy.internal.com
+http://foo.intel.com foo.intel.com
+PROXY proxy2.com; PROXY secproxy2.com
+smtp://mail.intel.com mail.intel.com
+DIRECT
+ftp://bar.redhat.com bar.redhat.com
+SOCKS4 server.one.com; SOCKS5 server.two.com
+imap://mail.redhat.com mail.redhat.com
+SOCKS4 server.one.com; SOCKS5 server.two.com
diff --git a/unit/suite/manual_exclude.test b/unit/suite/manual_exclude.test
index 211ae16..4281614 100644
--- a/unit/suite/manual_exclude.test
+++ b/unit/suite/manual_exclude.test
@@ -15,6 +15,9 @@
 *net
 tri*
 
+[browseronly]
+TRUE
+
 [domains]
 
 [config]
@@ -33,3 +36,11 @@
 DIRECT
 http://failed.com:99999/ failed.com
 DIRECT
+http://foo.intel.com foo.intel.com
+PROXY proxy2.com; PROXY secproxy2.com
+smtp://foo.intel.com foo.intel.com
+DIRECT
+imap://foo.redhat.com foo.redhat.com
+SOCKS4 server.one.com; SOCKS5 server.two.com
+smtp://no.match.com no.match.com
+DIRECT
diff --git a/unit/suite/pac_basic.test b/unit/suite/pac_basic.test
index c63757e..7975371 100644
--- a/unit/suite/pac_basic.test
+++ b/unit/suite/pac_basic.test
@@ -17,6 +17,9 @@
 
 [excludes]
 
+[browseronly]
+TRUE
+
 [domains]
 
 [config]
@@ -25,3 +28,5 @@
 [tests]
 http://www.example.com/site/test.html www.example.com
 PROXY proxy.example.com
+smtp://foo.com foo.com
+DIRECT
diff --git a/unit/suite/pac_direct.test b/unit/suite/pac_direct.test
index b820abc..a19519d 100644
--- a/unit/suite/pac_direct.test
+++ b/unit/suite/pac_direct.test
@@ -11,6 +11,9 @@
 
 [excludes]
 
+[browseronly]
+FALSE
+
 [domains]
 
 [config]
@@ -21,3 +24,5 @@
 DIRECT
 ftp://test.boujou.org test.boujou.org
 DIRECT
+smtp://foo.com foo.com
+DIRECT
diff --git a/unit/suite/proxy_domain.test b/unit/suite/proxy_domain.test
index 8c2c5e4..607f0af 100644
--- a/unit/suite/proxy_domain.test
+++ b/unit/suite/proxy_domain.test
@@ -8,6 +8,9 @@
 
 [excludes]
 
+[browseronly]
+TRUE
+
 [domains]
 suite.com
 test.suite.com
@@ -32,6 +35,12 @@
 http://192.168.4.4/index.html 192.168.4.4
 PROXY proxy2.com; PROXY secproxy2.com
 socks4://baz.domain3.com/xyz baz.domain3.com
-SOCKS4 sockproxy3.com; PROXY proxy3.com
+SOCKS4 server.one.com; SOCKS5 server.two.com
 http://[fe80:96db:12ce::43ef]/ip6.mp4 [fe80:96db:12ce::43ef]
-PROXY proxy3.com; SOCKS4 sockproxy3.com
+SOCKS4 server.one.com; SOCKS5 server.two.com
+imap://mail.google.com/id=inbox mail.google.com
+DIRECT
+imap://foo.redhat.com foo.redhat.com
+SOCKS4 server.one.com; SOCKS5 server.two.com
+smtp://bar.intel.com bar.intel.com
+DIRECT
diff --git a/unit/suite/stub.test b/unit/suite/stub.test
index cde0aeb..2b1238f 100644
--- a/unit/suite/stub.test
+++ b/unit/suite/stub.test
@@ -11,6 +11,9 @@
 [excludes]
 # If so, optional exlusion rules can be written here
 
+[browseronly]
+# Specifies if this configuration is for browser only schemes.
+
 [domains]
 # List of domains are here
 
diff --git a/unit/test-pacrunner.c b/unit/test-pacrunner.c
index e485c61..812789c 100644
--- a/unit/test-pacrunner.c
+++ b/unit/test-pacrunner.c
@@ -38,14 +38,15 @@
 #include "pacrunner.h"
 
 enum test_suite_part {
-	SUITE_TITLE    = 0,
-	SUITE_PAC      = 1,
-	SUITE_SERVERS  = 2,
-	SUITE_EXCLUDES = 3,
-	SUITE_DOMAINS  = 4,
-	SUITE_CONFIG   = 5,
-	SUITE_TESTS    = 6,
-	SUITE_NOTHING  = 7,
+	SUITE_TITLE        = 0,
+	SUITE_PAC          = 1,
+	SUITE_SERVERS      = 2,
+	SUITE_EXCLUDES     = 3,
+	SUITE_BROWSER_ONLY = 4,
+	SUITE_DOMAINS      = 5,
+	SUITE_CONFIG       = 6,
+	SUITE_TESTS        = 7,
+	SUITE_NOTHING      = 8,
 };
 
 enum cu_test_mode {
@@ -59,6 +60,7 @@
 	gchar *pac;
 	gchar **servers;
 	gchar **excludes;
+	gboolean browser_only;
 	gchar **domains;
 
 	bool config_result;
@@ -145,6 +147,9 @@
 	} else
 		printf("(none)\n");
 
+	printf("\nBrowser Only: %s\n",
+			suite->browser_only ? "TRUE" : "FALSE");
+
 	printf("\nDomains:\n");
 	if (suite->domains) {
 		for (line = suite->domains; *line; line++)
@@ -250,6 +255,13 @@
 				suite->excludes = array;
 
 				break;
+			case SUITE_BROWSER_ONLY:
+				if (strncmp(*line, "TRUE", 4) == 0)
+					suite->browser_only = TRUE;
+				else
+					suite->browser_only = FALSE;
+
+				break;
 			case SUITE_DOMAINS:
 				array = _g_strappendv(suite->domains, *line);
 				if (!array)
@@ -291,6 +303,8 @@
 			part = SUITE_SERVERS;
 		else if (strncmp(*line, "[excludes]", 10) == 0)
 			part = SUITE_EXCLUDES;
+		else if (strncmp(*line, "[browseronly]", 13) == 0)
+			part = SUITE_BROWSER_ONLY;
 		else if (strncmp(*line, "[domains]", 9) == 0)
 			part = SUITE_DOMAINS;
 		else if (strncmp(*line, "[config]", 8) == 0)
@@ -363,7 +377,8 @@
 {
 	int val = 0;
 
-	if (pacrunner_proxy_set_domains(proxy, test_suite->domains, FALSE) != 0)
+	if (pacrunner_proxy_set_domains(proxy, test_suite->domains,
+					test_suite->browser_only) != 0)
 		val = -1;
 
 	proxy2 = pacrunner_proxy_create("eth1");
@@ -381,15 +396,16 @@
 		if (pacrunner_proxy_set_manual(proxy2, servers, NULL) != 0)
 			val = -1;
 
-		if (pacrunner_proxy_set_domains(proxy2, domains, FALSE) != 0)
+		/* BrowserOnly = TRUE */
+		if (pacrunner_proxy_set_domains(proxy2, domains, TRUE) != 0)
 			val = -1;
 	}
 
 	proxy3 = pacrunner_proxy_create("wl0");
 	if (proxy3) {
 		char *servers[] = {
-			"http://proxy3.com",
-			"socks4://sockproxy3.com",
+			"socks4://server.one.com",
+			"socks5://server.two.com",
 			NULL};
 		char *domains[] = {
 			"redhat.com",
@@ -400,6 +416,7 @@
 		if (pacrunner_proxy_set_manual(proxy3, servers, NULL) != 0)
 			val = -1;
 
+		/* BrowserOnly = FALSE */
 		if (pacrunner_proxy_set_domains(proxy3, domains, FALSE) != 0)
 			val = -1;
 	}
@@ -499,9 +516,7 @@
 		CU_add_test(cu_suite, "Manual config test",
 						test_manual_config);
 
-	if (test_suite->domains)
-		CU_add_test(cu_suite, "Proxy domain test",
-						test_proxy_domain);
+	CU_add_test(cu_suite, "Proxy Domain test", test_proxy_domain);
 
 	if (test_suite->config_result && test_suite->tests)
 		CU_add_test(cu_suite, "Proxy requests test",
@@ -509,10 +524,10 @@
 
 	test_config = false;
 
-	if (test_suite->domains) {
+	if (proxy2)
 		pacrunner_proxy_unref(proxy2);
+	if (proxy3)
 		pacrunner_proxy_unref(proxy3);
-	}
 
 	switch (mode) {
 	case CU_MODE_BASIC: