Bug 1232631 - Write tests for network part of bug 1137681 draft
authorLeni Kadali <lenikmutungi@gmail.com>
Sat, 29 Apr 2017 13:54:04 +0300
changeset 570588 620d3f915ad83173898482af2ff3a819f1e96c71
parent 570587 03642bc7bc5e9ce0de75b41d385398b9191592b8
child 626521 19402de85030cf41eb99b624e61555ffa82606e7
push id56525
push userbmo:lenikmutungi@gmail.com
push dateSat, 29 Apr 2017 10:56:49 +0000
bugs1232631, 1137681
milestone55.0a1
Bug 1232631 - Write tests for network part of bug 1137681 Edited some formatting. Otherwise the file remains unchanged. I wanted help modifying the function isnot(getUA(location.origin), UA_OVERRIDE, "User-Agent is not reverted"); since both Dylan and Olli say they are not familiar enough with the code to propose how the function should be modified to suit the comments made starting here: https://bugzilla.mozilla.org/show_bug.cgi?id=1232631#c3 MozReview-Commit-ID: CEKPZZAuZu4
netwerk/test/mochitests/test_user_agent_updates_reset.html
--- a/netwerk/test/mochitests/test_user_agent_updates_reset.html
+++ b/netwerk/test/mochitests/test_user_agent_updates_reset.html
@@ -1,28 +1,29 @@
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=942470
 -->
 <head>
-  <title>Test for Bug 942470</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+<title>Test for Bug 942470</title>
+<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=942470">Mozilla Bug 942470</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 942470 **/
 
-function getUA(host) {
+function getUA(host) 
+{
   var url = location.pathname;
   url = host + url.slice(0, url.lastIndexOf('/')) + '/user_agent.sjs';
 
   var xhr = new XMLHttpRequest();
   xhr.open('GET', url, false); // sync request
   xhr.send();
   is(xhr.status, 200, 'request failed');
   is(typeof xhr.response, 'string', 'invalid response');