Backed out 2 changesets (bug 1248619) for devtools/client/responsive.html/test/unit/test_change_device.js failures
authorBogdan Tara <btara@mozilla.com>
Tue, 09 Oct 2018 22:43:50 +0300
changeset 496048 fb0c2bcc9bc616cc20d193969e0f4c14c7166600
parent 496047 e8214c1232867528c2a3956ace751ed3ba8f384b
child 496049 6f8701d1be0ccf42a8e22bfce6f40056a4f58a1b
child 496097 63551d28d39a9b4a7fee5402285f86cf2993eee3
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1248619
milestone64.0a1
backs outfb2a9e0b7538881fbe1c526d961338108ca4c967
ae15dbcedd8a73fc2a53b231354c49321da74ee1
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
Backed out 2 changesets (bug 1248619) for devtools/client/responsive.html/test/unit/test_change_device.js failures Backed out changeset fb2a9e0b7538 (bug 1248619) Backed out changeset ae15dbcedd8a (bug 1248619)
devtools/client/preferences/devtools-client.js
devtools/client/responsive.html/actions/devices.js
devtools/client/responsive.html/actions/viewports.js
devtools/client/responsive.html/index.js
devtools/client/responsive.html/manager.js
devtools/client/responsive.html/reducers/ui.js
devtools/client/responsive.html/reducers/viewports.js
devtools/client/responsive.html/test/browser/browser.ini
devtools/client/responsive.html/test/browser/browser_device_change.js
devtools/client/responsive.html/test/browser/browser_device_state_restore.js
devtools/client/responsive.html/test/browser/browser_state_restore.js
devtools/client/responsive.html/test/browser/head.js
--- a/devtools/client/preferences/devtools-client.js
+++ b/devtools/client/preferences/devtools-client.js
@@ -302,35 +302,24 @@ pref("devtools.hud.loglimit", 10000);
 pref("devtools.editor.tabsize", 2);
 pref("devtools.editor.expandtab", true);
 pref("devtools.editor.keymap", "default");
 pref("devtools.editor.autoclosebrackets", true);
 pref("devtools.editor.detectindentation", true);
 pref("devtools.editor.enableCodeFolding", true);
 pref("devtools.editor.autocomplete", true);
 
-// The width of the viewport.
-pref("devtools.responsive.viewport.width", 320);
-// The height of the viewport.
-pref("devtools.responsive.viewport.height", 480);
-// The pixel ratio of the viewport.
-pref("devtools.responsive.viewport.pixelRatio", 0);
 // Whether or not the viewports are left aligned.
 pref("devtools.responsive.leftAlignViewport.enabled", false);
 // Whether to reload when touch simulation is toggled
 pref("devtools.responsive.reloadConditions.touchSimulation", false);
 // Whether to reload when user agent is changed
 pref("devtools.responsive.reloadConditions.userAgent", false);
 // Whether to show the notification about reloading to apply emulation
 pref("devtools.responsive.reloadNotification.enabled", true);
-// Whether or not touch simulation is enabled.
-pref("devtools.responsive.touchSimulation.enabled", false);
-// The user agent of the viewport.
-pref("devtools.responsive.userAgent", "");
-
 // Whether to show the settings onboarding tooltip only in release or beta builds.
 #if defined(RELEASE_OR_BETA)
 pref("devtools.responsive.show-setting-tooltip", true);
 #else
 pref("devtools.responsive.show-setting-tooltip", false);
 #endif
 // Show the custom user agent input in Nightly builds.
 #if defined(NIGHTLY_BUILD)
--- a/devtools/client/responsive.html/actions/devices.js
+++ b/devtools/client/responsive.html/actions/devices.js
@@ -1,32 +1,28 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Services = require("Services");
-const asyncStorage = require("devtools/shared/async-storage");
 
 const {
   ADD_DEVICE,
   ADD_DEVICE_TYPE,
   LOAD_DEVICE_LIST_START,
   LOAD_DEVICE_LIST_ERROR,
   LOAD_DEVICE_LIST_END,
   REMOVE_DEVICE,
   UPDATE_DEVICE_DISPLAYED,
   UPDATE_DEVICE_MODAL,
 } = require("./index");
-const { post } = require("../utils/message");
 
 const { addDevice, getDevices, removeDevice } = require("devtools/client/shared/devices");
-const { changeUserAgent, toggleTouchSimulation } = require("./ui");
-const { changeDevice, changePixelRatio, resizeViewport } = require("./viewports");
 
 const DISPLAYED_DEVICES_PREF = "devtools.responsive.html.displayedDeviceList";
 
 /**
  * Returns an object containing the user preference of displayed devices.
  *
  * @return {Object} containing two Sets:
  * - added: Names of the devices that were explicitly enabled by the user
@@ -159,55 +155,16 @@ module.exports = {
       if (!devices.TYPES.find(type => type == "custom")) {
         dispatch(module.exports.addDeviceType("custom"));
       }
 
       dispatch({ type: LOAD_DEVICE_LIST_END });
     };
   },
 
-  restoreDeviceState() {
-    return async function(dispatch, getState) {
-      const deviceState = await asyncStorage.getItem("devtools.responsive.deviceState");
-      if (!deviceState) {
-        return;
-      }
-
-      const { id, device: deviceName, deviceType } = deviceState;
-      const devices = getState().devices;
-
-      if (!devices.types.includes(deviceType)) {
-        // Can't find matching device type.
-        return;
-      }
-
-      const device = devices[deviceType].find(d => d.name === deviceName);
-      if (!device) {
-        // Can't find device with the same device name.
-        return;
-      }
-
-      post(window, {
-        type: "viewport-resize",
-        width: device.width,
-        height: device.height,
-      });
-      post(window, {
-        type: "change-device",
-        device,
-      });
-
-      dispatch(resizeViewport(id, device.width, device.height));
-      dispatch(changeDevice(id, device.name, deviceType));
-      dispatch(changePixelRatio(id, device.pixelRatio));
-      dispatch(changeUserAgent(device.userAgent));
-      dispatch(toggleTouchSimulation(device.touch));
-    };
-  },
-
   updateDeviceModal(isOpen, modalOpenedFromViewport = null) {
     return {
       type: UPDATE_DEVICE_MODAL,
       isOpen,
       modalOpenedFromViewport,
     };
   },
 
--- a/devtools/client/responsive.html/actions/viewports.js
+++ b/devtools/client/responsive.html/actions/viewports.js
@@ -1,18 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* eslint-env browser */
 
 "use strict";
 
-const asyncStorage = require("devtools/shared/async-storage");
-
 const {
   ADD_VIEWPORT,
   CHANGE_DEVICE,
   CHANGE_PIXEL_RATIO,
   REMOVE_DEVICE_ASSOCIATION,
   RESIZE_VIEWPORT,
   ROTATE_VIEWPORT
 } = require("./index");
@@ -30,30 +28,21 @@ module.exports = {
       userContextId,
     };
   },
 
   /**
    * Change the viewport device.
    */
   changeDevice(id, device, deviceType) {
-    return async function(dispatch) {
-      try {
-        await asyncStorage.setItem("devtools.responsive.deviceState",
-          { id, device, deviceType });
-      } catch (e) {
-        console.error(e);
-      }
-
-      dispatch({
-        type: CHANGE_DEVICE,
-        id,
-        device,
-        deviceType,
-      });
+    return {
+      type: CHANGE_DEVICE,
+      id,
+      device,
+      deviceType,
     };
   },
 
   /**
    * Change the viewport pixel ratio.
    */
   changePixelRatio(id, pixelRatio = 0) {
     return {
@@ -62,25 +51,20 @@ module.exports = {
       pixelRatio,
     };
   },
 
   /**
    * Remove the viewport's device assocation.
    */
   removeDeviceAssociation(id) {
-    return async function(dispatch) {
-      post(window, "remove-device-association");
-
-      dispatch({
-        type: REMOVE_DEVICE_ASSOCIATION,
-        id,
-      });
-
-      await asyncStorage.removeItem("devtools.responsive.deviceState");
+    post(window, "remove-device-association");
+    return {
+      type: REMOVE_DEVICE_ASSOCIATION,
+      id,
     };
   },
 
   /**
    * Resize the viewport.
    */
   resizeViewport(id, width, height) {
     return {
--- a/devtools/client/responsive.html/index.js
+++ b/devtools/client/responsive.html/index.js
@@ -17,17 +17,17 @@ const Telemetry = require("devtools/clie
 const { createFactory, createElement } =
   require("devtools/client/shared/vendor/react");
 const ReactDOM = require("devtools/client/shared/vendor/react-dom");
 const { Provider } = require("devtools/client/shared/vendor/react-redux");
 
 const message = require("./utils/message");
 const App = createFactory(require("./components/App"));
 const Store = require("./store");
-const { loadDevices, restoreDeviceState } = require("./actions/devices");
+const { loadDevices } = require("./actions/devices");
 const { addViewport, resizeViewport } = require("./actions/viewports");
 const { changeDisplayPixelRatio } = require("./actions/ui");
 
 // Exposed for use by tests
 window.require = require;
 
 const bootstrap = {
 
@@ -73,19 +73,17 @@ const bootstrap = {
 };
 
 // manager.js sends a message to signal init
 message.wait(window, "init").then(() => bootstrap.init());
 
 // manager.js sends a message to signal init is done, which can be used for delayed
 // startup work that shouldn't block initial load
 message.wait(window, "post-init").then(() => {
-  bootstrap.store.dispatch(loadDevices()).then(() => {
-    bootstrap.dispatch(restoreDeviceState());
-  });
+  bootstrap.dispatch(loadDevices());
 });
 
 window.addEventListener("unload", function() {
   bootstrap.destroy();
 }, {once: true});
 
 // Allows quick testing of actions from the console
 window.dispatch = action => bootstrap.dispatch(action);
--- a/devtools/client/responsive.html/manager.js
+++ b/devtools/client/responsive.html/manager.js
@@ -2,36 +2,35 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { Ci } = require("chrome");
 const promise = require("promise");
 const Services = require("Services");
-const asyncStorage = require("devtools/shared/async-storage");
 const EventEmitter = require("devtools/shared/event-emitter");
 
+const TOOL_URL = "chrome://devtools/content/responsive.html/index.xhtml";
+
 loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/debugger-client", true);
 loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
 loader.lazyRequireGetter(this, "throttlingProfiles", "devtools/client/shared/components/throttling/profiles");
 loader.lazyRequireGetter(this, "SettingOnboardingTooltip", "devtools/client/responsive.html/setting-onboarding-tooltip");
 loader.lazyRequireGetter(this, "swapToInnerBrowser", "devtools/client/responsive.html/browser/swap", true);
 loader.lazyRequireGetter(this, "startup", "devtools/client/responsive.html/utils/window", true);
 loader.lazyRequireGetter(this, "message", "devtools/client/responsive.html/utils/message");
 loader.lazyRequireGetter(this, "showNotification", "devtools/client/responsive.html/utils/notification", true);
 loader.lazyRequireGetter(this, "l10n", "devtools/client/responsive.html/utils/l10n");
 loader.lazyRequireGetter(this, "EmulationFront", "devtools/shared/fronts/emulation", true);
 loader.lazyRequireGetter(this, "PriorityLevels", "devtools/client/shared/components/NotificationBox", true);
 loader.lazyRequireGetter(this, "TargetFactory", "devtools/client/framework/target", true);
 loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
 loader.lazyRequireGetter(this, "Telemetry", "devtools/client/shared/telemetry");
 
-const TOOL_URL = "chrome://devtools/content/responsive.html/index.xhtml";
-
 const RELOAD_CONDITION_PREF_PREFIX = "devtools.responsive.reloadConditions.";
 const RELOAD_NOTIFICATION_PREF = "devtools.responsive.reloadNotification.enabled";
 const SHOW_SETTING_TOOLTIP_PREF = "devtools.responsive.show-setting-tooltip";
 
 function debug(msg) {
   // console.log(`RDM manager: ${msg}`);
 }
 
@@ -357,19 +356,16 @@ ResponsiveUI.prototype = {
     // Notify the inner browser to start the frame script
     debug("Wait until start frame script");
     await message.request(this.toolWindow, "start-frame-script");
 
     // Get the protocol ready to speak with emulation actor
     debug("Wait until RDP server connect");
     await this.connectToServer();
 
-    // Restore the previous state of RDM.
-    await this.restoreState();
-
     // Show the settings onboarding tooltip
     if (Services.prefs.getBoolPref(SHOW_SETTING_TOOLTIP_PREF)) {
       this.settingOnboardingTooltip =
         new SettingOnboardingTooltip(ui.toolWindow.document);
     }
 
     // Non-blocking message to tool UI to start any delayed init activities
     message.post(this.toolWindow, "post-init");
@@ -534,17 +530,17 @@ ResponsiveUI.prototype = {
         break;
       case "content-resize":
         this.onContentResize(event);
         break;
       case "exit":
         this.onExit();
         break;
       case "remove-device-association":
-        this.onRemoveDeviceAssociation();
+        this.onRemoveDeviceAssociation(event);
         break;
       case "viewport-resize":
         this.onViewportResize(event);
         break;
     }
   },
 
   async onChangeDevice(event) {
@@ -603,17 +599,17 @@ ResponsiveUI.prototype = {
     });
   },
 
   onExit() {
     const { browserWindow, tab } = this;
     ResponsiveUIManager.closeIfNeeded(browserWindow, tab);
   },
 
-  async onRemoveDeviceAssociation() {
+  async onRemoveDeviceAssociation(event) {
     let reloadNeeded = false;
     await this.updateDPPX();
     reloadNeeded |= await this.updateUserAgent() &&
                     this.reloadOnChange("userAgent");
     reloadNeeded |= await this.updateTouchSimulation() &&
                     this.reloadOnChange("touchSimulation");
     if (reloadNeeded) {
       this.getViewportBrowser().reload();
@@ -626,50 +622,16 @@ ResponsiveUI.prototype = {
     const { width, height } = event.data;
     this.emit("viewport-resize", {
       width,
       height,
     });
   },
 
   /**
-   * Restores the previous state of RDM.
-   */
-  async restoreState() {
-    const deviceState = await asyncStorage.getItem("devtools.responsive.deviceState");
-    if (deviceState) {
-      // Return if there is a device state to restore, this will be done when the
-      // device list is loaded after the post-init.
-      return;
-    }
-
-    const pixelRatio =
-      Services.prefs.getIntPref("devtools.responsive.viewport.pixelRatio", 0);
-    const touchSimulationEnabled =
-      Services.prefs.getBoolPref("devtools.responsive.touchSimulation.enabled", false);
-    const userAgent = Services.prefs.getCharPref("devtools.responsive.userAgent", "");
-
-    let reloadNeeded = false;
-
-    await this.updateDPPX(pixelRatio);
-
-    if (touchSimulationEnabled) {
-      reloadNeeded |= await this.updateTouchSimulation(touchSimulationEnabled) &&
-                      this.reloadOnChange("touchSimulation");
-    }
-    if (userAgent) {
-      reloadNeeded |= await this.updateUserAgent(userAgent) &&
-                      this.reloadOnChange("userAgent");
-    }
-    if (reloadNeeded) {
-      this.getViewportBrowser().reload();
-    }
-  },
-
-  /**
    * Set or clear the emulated device pixel ratio.
    *
    * @return boolean
    *         Whether a reload is needed to apply the change.
    *         (This is always immediate, so it's always false.)
    */
   async updateDPPX(dppx) {
     if (!dppx) {
--- a/devtools/client/responsive.html/reducers/ui.js
+++ b/devtools/client/responsive.html/reducers/ui.js
@@ -15,48 +15,44 @@ const {
   TOGGLE_TOUCH_SIMULATION,
   TOGGLE_USER_AGENT_INPUT,
 } = require("../actions/index");
 
 const LEFT_ALIGNMENT_ENABLED = "devtools.responsive.leftAlignViewport.enabled";
 const RELOAD_ON_TOUCH_SIMULATION = "devtools.responsive.reloadConditions.touchSimulation";
 const RELOAD_ON_USER_AGENT = "devtools.responsive.reloadConditions.userAgent";
 const SHOW_USER_AGENT_INPUT = "devtools.responsive.showUserAgentInput";
-const TOUCH_SIMULATION_ENABLED = "devtools.responsive.touchSimulation.enabled";
-const USER_AGENT = "devtools.responsive.userAgent";
 
 const INITIAL_UI = {
   // The pixel ratio of the display.
   displayPixelRatio: 0,
   // Whether or not the viewports are left aligned.
-  leftAlignmentEnabled: Services.prefs.getBoolPref(LEFT_ALIGNMENT_ENABLED, false),
+  leftAlignmentEnabled: Services.prefs.getBoolPref(LEFT_ALIGNMENT_ENABLED),
   // Whether or not to reload when touch simulation is toggled.
-  reloadOnTouchSimulation: Services.prefs.getBoolPref(RELOAD_ON_TOUCH_SIMULATION, false),
+  reloadOnTouchSimulation: Services.prefs.getBoolPref(RELOAD_ON_TOUCH_SIMULATION),
   // Whether or not to reload when user agent is changed.
-  reloadOnUserAgent: Services.prefs.getBoolPref(RELOAD_ON_USER_AGENT, false),
+  reloadOnUserAgent: Services.prefs.getBoolPref(RELOAD_ON_USER_AGENT),
   // Whether or not to show the user agent input in the toolbar.
-  showUserAgentInput: Services.prefs.getBoolPref(SHOW_USER_AGENT_INPUT, false),
+  showUserAgentInput: Services.prefs.getBoolPref(SHOW_USER_AGENT_INPUT),
   // Whether or not touch simulation is enabled.
-  touchSimulationEnabled: Services.prefs.getBoolPref(TOUCH_SIMULATION_ENABLED, false),
+  touchSimulationEnabled: false,
   // The user agent of the viewport.
-  userAgent: Services.prefs.getCharPref(USER_AGENT, ""),
+  userAgent: "",
 };
 
 const reducers = {
 
   [CHANGE_DISPLAY_PIXEL_RATIO](ui, { displayPixelRatio }) {
     return {
       ...ui,
       displayPixelRatio,
     };
   },
 
   [CHANGE_USER_AGENT](ui, { userAgent }) {
-    Services.prefs.setCharPref(USER_AGENT, userAgent);
-
     return {
       ...ui,
       userAgent,
     };
   },
 
   [TOGGLE_LEFT_ALIGNMENT](ui, { enabled }) {
     const leftAlignmentEnabled = enabled !== undefined ?
@@ -90,18 +86,16 @@ const reducers = {
 
     return {
       ...ui,
       reloadOnUserAgent,
     };
   },
 
   [TOGGLE_TOUCH_SIMULATION](ui, { enabled }) {
-    Services.prefs.setBoolPref(TOUCH_SIMULATION_ENABLED, enabled);
-
     return {
       ...ui,
       touchSimulationEnabled: enabled,
     };
   },
 
   [TOGGLE_USER_AGENT_INPUT](ui, { enabled }) {
     const showUserAgentInput = enabled !== undefined ?
--- a/devtools/client/responsive.html/reducers/viewports.js
+++ b/devtools/client/responsive.html/reducers/viewports.js
@@ -1,39 +1,33 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const Services = require("Services");
-
 const {
   ADD_VIEWPORT,
   CHANGE_DEVICE,
   CHANGE_PIXEL_RATIO,
   REMOVE_DEVICE_ASSOCIATION,
   RESIZE_VIEWPORT,
   ROTATE_VIEWPORT,
 } = require("../actions/index");
 
-const VIEWPORT_WIDTH_PREF = "devtools.responsive.viewport.width";
-const VIEWPORT_HEIGHT_PREF = "devtools.responsive.viewport.height";
-const VIEWPORT_PIXEL_RATIO_PREF = "devtools.responsive.viewport.pixelRatio";
-
 let nextViewportId = 0;
 
 const INITIAL_VIEWPORTS = [];
 const INITIAL_VIEWPORT = {
   id: nextViewportId++,
   device: "",
   deviceType: "",
-  height: Services.prefs.getIntPref(VIEWPORT_HEIGHT_PREF, 480),
-  width: Services.prefs.getIntPref(VIEWPORT_WIDTH_PREF, 320),
-  pixelRatio: Services.prefs.getIntPref(VIEWPORT_PIXEL_RATIO_PREF, 0),
+  height: 480,
+  width: 320,
+  pixelRatio: 0,
   userContextId: 0,
 };
 
 const reducers = {
 
   [ADD_VIEWPORT](viewports, { userContextId }) {
     // For the moment, there can be at most one viewport.
     if (viewports.length === 1) {
@@ -64,18 +58,16 @@ const reducers = {
   },
 
   [CHANGE_PIXEL_RATIO](viewports, { id, pixelRatio }) {
     return viewports.map(viewport => {
       if (viewport.id !== id) {
         return viewport;
       }
 
-      Services.prefs.setIntPref(VIEWPORT_PIXEL_RATIO_PREF, pixelRatio);
-
       return {
         ...viewport,
         pixelRatio,
       };
     });
   },
 
   [REMOVE_DEVICE_ASSOCIATION](viewports, { id }) {
@@ -101,19 +93,16 @@ const reducers = {
       if (!height) {
         height = viewport.height;
       }
 
       if (!width) {
         width = viewport.width;
       }
 
-      Services.prefs.setIntPref(VIEWPORT_WIDTH_PREF, width);
-      Services.prefs.setIntPref(VIEWPORT_HEIGHT_PREF, height);
-
       return {
         ...viewport,
         height,
         width,
       };
     });
   },
 
--- a/devtools/client/responsive.html/test/browser/browser.ini
+++ b/devtools/client/responsive.html/test/browser/browser.ini
@@ -27,17 +27,16 @@ support-files =
 [browser_contextual_identity.js]
 [browser_device_change.js]
 [browser_device_custom_remove.js]
 [browser_device_custom.js]
 [browser_device_modal_error.js]
 [browser_device_modal_exit.js]
 [browser_device_modal_submit.js]
 [browser_device_pixel_ratio_change.js]
-[browser_device_state_restore.js]
 [browser_device_width.js]
 [browser_exit_button.js]
 [browser_ext_messaging.js]
 tags = devtools webextensions
 [browser_favicon.js]
 [browser_frame_script_active.js]
 [browser_hide_container.js]
 [browser_menu_item_01.js]
@@ -47,17 +46,16 @@ tags = devtools webextensions
 skip-if = true # Bug 1413765
 [browser_network_throttling.js]
 [browser_page_state.js]
 [browser_permission_doorhanger.js]
 tags = devtools geolocation
 skip-if = true # Bug 1413765
 [browser_preloaded_newtab.js]
 [browser_screenshot_button.js]
-[browser_state_restore.js]
 [browser_tab_close.js]
 [browser_tab_remoteness_change.js]
 [browser_target_blank.js]
 [browser_telemetry_activate_rdm.js]
 [browser_toolbox_computed_view.js]
 [browser_toolbox_rule_view.js]
 [browser_toolbox_rule_view_reload.js]
 [browser_toolbox_swap_browsers.js]
--- a/devtools/client/responsive.html/test/browser/browser_device_change.js
+++ b/devtools/client/responsive.html/test/browser/browser_device_change.js
@@ -79,20 +79,18 @@ add_task(async function() {
   const tab = await addTab(TEST_URL);
   const { ui } = await openRDM(tab);
 
   const { store } = ui.toolWindow;
 
   reloadOnUAChange(true);
 
   // Wait until the viewport has been added and the device list has been loaded
-  await waitUntilState(store, state =>
-    state.viewports.length == 1 &&
-    state.viewports[0].device === "Laptop (1366 x 768)" &&
-    state.devices.listState == Types.loadableState.LOADED);
+  await waitUntilState(store, state => state.viewports.length == 1
+    && state.devices.listState == Types.loadableState.LOADED);
 
   // Select device with custom UA
   let reloaded = waitForViewportLoad(ui);
   await selectDevice(ui, "Fake Phone RDM Test");
   await reloaded;
   await waitForViewportResizeTo(ui, testDevice.width, testDevice.height);
   info("Should have device UA now that device is applied");
   await testUserAgent(ui, testDevice.userAgent);
@@ -105,8 +103,22 @@ add_task(async function() {
   // Ensure UA is reset to default after closing RDM
   info("Should have default UA after closing RDM");
   await testUserAgentFromBrowser(tab.linkedBrowser, DEFAULT_UA);
 
   await removeTab(tab);
 
   reloadOnUAChange(false);
 });
+
+function testViewportDimensions(ui, w, h) {
+  const viewport = ui.toolWindow.document.querySelector(".viewport-content");
+
+  is(ui.toolWindow.getComputedStyle(viewport).getPropertyValue("width"),
+     `${w}px`, `Viewport should have width of ${w}px`);
+  is(ui.toolWindow.getComputedStyle(viewport).getPropertyValue("height"),
+     `${h}px`, `Viewport should have height of ${h}px`);
+}
+
+async function testDevicePixelRatio(ui, expected) {
+  const dppx = await getViewportDevicePixelRatio(ui);
+  is(dppx, expected, `devicePixelRatio should be set to ${expected}`);
+}
deleted file mode 100644
--- a/devtools/client/responsive.html/test/browser/browser_device_state_restore.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Test that the previous selected device is restored when reopening RDM.
-
-const TEST_URL = "data:text/html;charset=utf-8,";
-const DEFAULT_DPPX = window.devicePixelRatio;
-
-/* eslint-disable max-len */
-const TEST_DEVICE = {
-  "name": "Apple iPhone 6s",
-  "width": 375,
-  "height": 667,
-  "pixelRatio": 2,
-  "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4",
-  "touch": true,
-  "firefoxOS": false,
-  "os": "ios",
-  "featured": true
-};
-/* eslint-enable max-len */
-
-const Types = require("devtools/client/responsive.html/types");
-
-addRDMTask(TEST_URL, async function({ ui }) {
-  const { store } = ui.toolWindow;
-
-  reloadOnUAChange(true);
-
-  // Wait until the viewport has been added and the device list has been loaded
-  await waitUntilState(store, state => state.viewports.length == 1
-    && state.devices.listState == Types.loadableState.LOADED);
-
-  info("Checking the default RDM state.");
-  testViewportDeviceMenuLabel(ui, "Responsive");
-  testViewportDimensions(ui, 320, 480);
-  await testUserAgent(ui, DEFAULT_UA);
-  await testDevicePixelRatio(ui, DEFAULT_DPPX);
-  await testTouchEventsOverride(ui, false);
-
-  info("Select a device");
-  const reloaded = waitForViewportLoad(ui);
-  await selectDevice(ui, TEST_DEVICE.name);
-  await reloaded;
-  await waitForViewportResizeTo(ui, TEST_DEVICE.width, TEST_DEVICE.height);
-
-  info("Checking the RDM device state.");
-  testViewportDeviceMenuLabel(ui, TEST_DEVICE.name);
-  await testUserAgent(ui, TEST_DEVICE.userAgent);
-  await testDevicePixelRatio(ui, TEST_DEVICE.pixelRatio);
-  await testTouchEventsOverride(ui, TEST_DEVICE.touch);
-
-  reloadOnUAChange(false);
-});
-
-addRDMTask(TEST_URL, async function({ ui }) {
-  const { store } = ui.toolWindow;
-
-  reloadOnUAChange(true);
-
-  info("Reopening RDM and checking that the previous device state is restored.");
-
-  // Wait until the viewport has been added and the device list has been loaded
-  await waitUntilState(store, state =>
-    state.viewports.length == 1 &&
-    state.viewports[0].device === TEST_DEVICE.name &&
-    state.devices.listState == Types.loadableState.LOADED);
-  await waitForViewportResizeTo(ui, TEST_DEVICE.width, TEST_DEVICE.height);
-  await waitForViewportLoad(ui);
-
-  info("Checking the restored RDM state.");
-  testViewportDeviceMenuLabel(ui, TEST_DEVICE.name);
-  testViewportDimensions(ui, TEST_DEVICE.width, TEST_DEVICE.height);
-  await testUserAgent(ui, TEST_DEVICE.userAgent);
-  await testDevicePixelRatio(ui, TEST_DEVICE.pixelRatio);
-  await testTouchEventsOverride(ui, TEST_DEVICE.touch);
-
-  reloadOnUAChange(false);
-});
deleted file mode 100644
--- a/devtools/client/responsive.html/test/browser/browser_state_restore.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Test that the previous viewport size, user agent, ddppx and touch simulation properties
-// are restored when reopening RDM.
-
-const TEST_URL = "data:text/html;charset=utf-8,";
-const DEFAULT_DPPX = window.devicePixelRatio;
-const NEW_DPPX = DEFAULT_DPPX + 1;
-const NEW_USER_AGENT = "Mozilla/5.0 (Mobile; rv:39.0) Gecko/39.0 Firefox/39.0";
-
-addRDMTask(TEST_URL, async function({ ui, manager }) {
-  const { store } = ui.toolWindow;
-
-  reloadOnTouchChange(true);
-  reloadOnUAChange(true);
-
-  await waitUntilState(store, state => state.viewports.length == 1);
-
-  info("Checking the default RDM state.");
-  testViewportDeviceMenuLabel(ui, "Responsive");
-  testViewportDimensions(ui, 320, 480);
-  await testUserAgent(ui, DEFAULT_UA);
-  await testDevicePixelRatio(ui, DEFAULT_DPPX);
-  await testTouchEventsOverride(ui, false);
-
-  info("Changing the RDM size, dppx, ua and toggle ON touch simulations.");
-  await setViewportSize(ui, manager, 90, 500);
-  await selectDevicePixelRatio(ui, NEW_DPPX);
-  await toggleTouchSimulation(ui);
-  await changeUserAgentInput(ui, NEW_USER_AGENT);
-
-  reloadOnTouchChange(false);
-  reloadOnUAChange(false);
-});
-
-addRDMTask(TEST_URL, async function({ ui }) {
-  const { store } = ui.toolWindow;
-
-  reloadOnTouchChange(true);
-  reloadOnUAChange(true);
-
-  info("Reopening RDM and checking that the previous device state is restored.");
-
-  await waitUntilState(store, state => state.viewports.length == 1);
-
-  testViewportDimensions(ui, 90, 500);
-  await testUserAgent(ui, NEW_USER_AGENT);
-  await testDevicePixelRatio(ui, NEW_DPPX);
-  await testTouchEventsOverride(ui, true);
-
-  reloadOnTouchChange(false);
-  reloadOnUAChange(false);
-});
--- a/devtools/client/responsive.html/test/browser/head.js
+++ b/devtools/client/responsive.html/test/browser/head.js
@@ -60,23 +60,17 @@ Services.prefs.setBoolPref("devtools.res
 registerCleanupFunction(async () => {
   Services.prefs.clearUserPref("devtools.devices.url");
   Services.prefs.clearUserPref("devtools.responsive.reloadNotification.enabled");
   Services.prefs.clearUserPref("devtools.responsive.html.displayedDeviceList");
   Services.prefs.clearUserPref("devtools.responsive.reloadConditions.touchSimulation");
   Services.prefs.clearUserPref("devtools.responsive.reloadConditions.userAgent");
   Services.prefs.clearUserPref("devtools.responsive.show-setting-tooltip");
   Services.prefs.clearUserPref("devtools.responsive.showUserAgentInput");
-  Services.prefs.clearUserPref("devtools.responsive.touchSimulation.enabled");
-  Services.prefs.clearUserPref("devtools.responsive.userAgent");
-  Services.prefs.clearUserPref("devtools.responsive.viewport.height");
-  Services.prefs.clearUserPref("devtools.responsive.viewport.pixelRatio");
-  Services.prefs.clearUserPref("devtools.responsive.viewport.width");
   await asyncStorage.removeItem("devtools.devices.url_cache");
-  await asyncStorage.removeItem("devtools.responsive.deviceState");
   await removeLocalDevices();
 });
 
 /**
  * Open responsive design mode for the given tab.
  */
 var openRDM = async function(tab) {
   info("Opening responsive design mode");
@@ -378,21 +372,16 @@ function addDeviceForTest(device) {
 }
 
 async function waitForClientClose(ui) {
   info("Waiting for RDM debugger client to close");
   await ui.client.addOneTimeListener("closed");
   info("RDM's debugger client is now closed");
 }
 
-async function testDevicePixelRatio(ui, expected) {
-  const dppx = await getViewportDevicePixelRatio(ui);
-  is(dppx, expected, `devicePixelRatio should be set to ${expected}`);
-}
-
 async function testTouchEventsOverride(ui, expected) {
   const { document } = ui.toolWindow;
   const touchButton = document.getElementById("touch-simulation-button");
 
   const flag = await ui.emulationFront.getTouchEventsOverride();
   is(flag === Ci.nsIDocShell.TOUCHEVENTS_OVERRIDE_ENABLED, expected,
     `Touch events override should be ${expected ? "enabled" : "disabled"}`);
   is(touchButton.classList.contains("checked"), expected,
@@ -430,25 +419,16 @@ async function testUserAgent(ui, expecte
 
 async function testUserAgentFromBrowser(browser, expected) {
   const ua = await ContentTask.spawn(browser, {}, async function() {
     return content.navigator.userAgent;
   });
   is(ua, expected, `UA should be set to ${expected}`);
 }
 
-function testViewportDimensions(ui, w, h) {
-  const viewport = ui.toolWindow.document.querySelector(".viewport-content");
-
-  is(ui.toolWindow.getComputedStyle(viewport).getPropertyValue("width"),
-     `${w}px`, `Viewport should have width of ${w}px`);
-  is(ui.toolWindow.getComputedStyle(viewport).getPropertyValue("height"),
-     `${h}px`, `Viewport should have height of ${h}px`);
-}
-
 async function changeUserAgentInput(ui, value) {
   const { Simulate } =
     ui.toolWindow.require("devtools/client/shared/vendor/react-dom-test-utils");
   const { document, store } = ui.toolWindow;
 
   const userAgentInput = document.getElementById("user-agent-input");
   userAgentInput.value = value;
   Simulate.change(userAgentInput);