summaryrefslogtreecommitdiffstats
path: root/devtools/client/responsive/test/browser/browser_user_agent_input.js
blob: cd7b843790e3fc17048da97336bbb917fbc32d2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

const TEST_URL = "data:text/html;charset=utf-8,";
const NEW_USER_AGENT = "Mozilla/5.0 (Mobile; rv:39.0) Gecko/39.0 Firefox/39.0";

addRDMTask(TEST_URL, async function ({ ui }) {
  reloadOnUAChange(true);

  info("Check the default state of the user agent input");
  await testUserAgent(ui, DEFAULT_UA);

  info(`Change the user agent input to ${NEW_USER_AGENT}`);
  await changeUserAgentInput(ui, NEW_USER_AGENT);
  await testUserAgent(ui, NEW_USER_AGENT);

  info("Reset the user agent input back to the default UA");
  await changeUserAgentInput(ui, "");
  await testUserAgent(ui, DEFAULT_UA);

  reloadOnUAChange(false);
});