Bug 1255894: Part 8.1 - Disable response data filtering in release builds. r=me
authorKris Maglione <maglione.k@gmail.com>
Sat, 02 Sep 2017 09:40:30 -0700
changeset 428220 15097fdfa8e972216cb71cfd98c95591cf857e55
parent 428219 cc92f00288cd3e433f47ab7d5d724afbc46d0450
child 428221 96b6a3d0231b93016f6d35a55b8f5ed98a6a8712
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1255894
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1255894: Part 8.1 - Disable response data filtering in release builds. r=me MozReview-Commit-ID: AMgXJAb1NFs
toolkit/components/extensions/ext-c-webRequest.js
toolkit/components/extensions/test/mochitest/mochitest-common.ini
toolkit/components/extensions/test/mochitest/test_ext_webrequest_responseBody.html
--- a/toolkit/components/extensions/ext-c-webRequest.js
+++ b/toolkit/components/extensions/ext-c-webRequest.js
@@ -1,17 +1,24 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
+var {
+  ExtensionError,
+} = ExtensionCommon;
+
 this.webRequest = class extends ExtensionAPI {
   getAPI(context) {
     return {
       webRequest: {
         filterResponseData(requestId) {
+          if (AppConstants.RELEASE_OR_BETA) {
+            throw new ExtensionError("filterResponseData() unsupported in release builds");
+          }
           requestId = parseInt(requestId, 10);
 
           return context.cloneScope.StreamFilter.create(
             requestId, context.extension.id);
         },
       },
     };
   }
--- a/toolkit/components/extensions/test/mochitest/mochitest-common.ini
+++ b/toolkit/components/extensions/test/mochitest/mochitest-common.ini
@@ -126,16 +126,17 @@ skip-if = os == 'android'
 [test_ext_webrequest_auth.html]
 skip-if = os == 'android'
 [test_ext_webrequest_background_events.html]
 [test_ext_webrequest_hsts.html]
 [test_ext_webrequest_basic.html]
 [test_ext_webrequest_filter.html]
 [test_ext_webrequest_frameId.html]
 [test_ext_webrequest_responseBody.html]
+skip-if = release_or_beta
 [test_ext_webrequest_suspend.html]
 [test_ext_webrequest_upload.html]
 skip-if = os == 'android' # Currently fails in emulator tests
 [test_ext_webrequest_permission.html]
 [test_ext_webrequest_websocket.html]
 [test_ext_webnavigation.html]
 [test_ext_webnavigation_filters.html]
 [test_ext_window_postMessage.html]
--- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_responseBody.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_responseBody.html
@@ -275,16 +275,17 @@ const TASKS = [
       filter.onerror = event => {
         browser.test.fail(`(${num}): Got unexpected error event: ${filter.error}`);
       };
     },
     verify(response) {
       is(response, PARTS.slice(0, 3).join(""), "Got expected final HTML");
     },
   },
+/*
   {
     url: "lorem.html.gz",
     task(filter, resolve, num) {
       let response = "";
       let decoder = new TextDecoder("utf-8");
 
       filter.onstart = event => {
         browser.test.log(`(${num}): Request start`);
@@ -316,16 +317,17 @@ const TASKS = [
       filter.onerror = event => {
         browser.test.fail(`(${num}): Got unexpected error event: ${filter.error}`);
       };
     },
     verify(response) {
       is(response, PARTS.join(""), "Got expected final HTML");
     },
   },
+*/
 ];
 
 function serializeTest(test, num) {
   /* globals ExtensionTestCommon */
 
   let url = `${test.url}?test_num=${num}`;
   let task = ExtensionTestCommon.serializeFunction(test.task);