Skip to content

Instantly share code, notes, and snippets.

@biancadanforth
Last active August 27, 2019 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biancadanforth/f792737eb10a45cdb89361a4cfb290b7 to your computer and use it in GitHub Desktop.
Save biancadanforth/f792737eb10a45cdb89361a4cfb290b7 to your computer and use it in GitHub Desktop.
Bug 1542035 QA Test Plan

((Below is the QA Test Plan. I will upload the test extensions before merge day.))

Bug 1542035 QA Test Plan

Setup

  1. Open Firefox Beta 70 in a new profile
  2. Download the following test extensions attached to this bug:
  • Test Extension 1: 1542035-test-extension-1-1.0.zip
    • Extension with Background script and browserAction toolbar button. Clicking the browserAction toolbar button opens a popup with a menu.
  • Test Extension 2: 1542035-test-extension-2-1.0.zip
    • Extension with no Background script and a browserAction toolbar button. Clicking the browserAction toolbar button opens a popup with a menu.

Notes about the test extensions:

  • For any non-add operations (i.e. edit, remove, remove all), storage items must first be added.
  • Any non-add bulk operations will affect all storage items if there are less than 10 in total.

Verify Extension Storage is not listed in the Storage panel sidebar when ...

The Storage panel is in the addon toolbox and the feature is disabled

  1. In about:config, set devtools.storage.extensionStorage.enabled to false.
  2. Load Test Extension 1 in about:debugging.
  3. Open the addon toolbox for Test Extension 1 in about:debugging, and select the Storage panel.
  4. Verify "Extension Storage" is not listed in the left sidebar.

The Storage panel is in a non-addon toolbox and the feature is enabled

  1. In about:config, set devtools.storage.extensionStorage.enabled to true.
  2. Load Test Extension 1 in about:debugging.
  3. Open a page in a new tab (e.g. https://www.mozilla.org/).
  4. Open the in-page toolbox and select the Storage panel.
  5. Verify "Extension Storage" is not listed in the left sidebar.

Verify Storage panel data matches expected data when...

Storage data is modified by various different scripts in the same session

Important: Complete these checks for both Test Extension 1 and Test Extension 2 (referred to as Test Extension below):

  1. In about:config, set devtools.storage.extensionStorage.enabled to true.
  2. Load Test Extension in about:debugging.
  3. If Test Extension 1, open any http(s) page in a new tab (e.g. https://www.mozilla.org/).
  4. Click the browserAction toolbar icon.
  5. For each option in the browserAction popup:
  • Click an option, e.g. "Background script adds a new storage item" or "browserAction script adds a new storage item".
  • Open the addon toolbox for Test Extension in about:debugging.
  • Select the Console panel and note the storage item(s) that is/are modified.
  • Open the Storage panel and select the extension under "Extension Storage" in the sidebar.
  • Verify the storage data displayed in the panel reflects the modification(s).
    • The Storage panel should display the correct data whether the addon toolbox is left open or closed and re-opened each time.

Storage data is modified by various different scripts, and then the extension is restarted

Important: Complete these checks for both Test Extension 1 and Test Extension 2 (referred to as Test Extension below):

  1. Remove any previous installation of Test Extension 1 and/or Test Extension 2.
  2. In about:config, set devtools.storage.extensionStorage.enabled to true.
  3. If Test Extension 1, open any http(s) page in a new tab (e.g. https://www.mozilla.org/).
  4. Load Test Extension in about:debugging.
  5. Click the browserAction toolbar icon.
  6. In the popup, click 'Background script bulk adds several storage items' or 'browserAction script bulk adds several storage items'.
  7. Open the addon toolbox for Test Extension in about:debugging.
  8. Select the Storage panel, and select the extension under "Extension Storage" in the sidebar and note the storage items added.
  9. Leaving the Storage panel open, disable the extension in about:addons.
  10. Enable the extension in about:addons.
  11. Verify the storage data in the panel matches the data added prior to disabling the addon.

Verify JSONifiable values display as-is while non-JSONifiable values display as "Object"

  1. Remove any previous installation of Test Extension 1 and/or Test Extension 2.
  2. In about:config, set devtools.storage.extensionStorage.enabled to true.
  3. Load Test Extension 1 in about:debugging.
  4. Open the addon toolbox for Test Extension 1 in about:debugging.
  5. Select the Console panel, and for each of the following stringifiable items, verify they are set as a string equivalent in the Storage panel (Note: the Console panel does not always provide helpful error messages for incorrect syntax, so it is recommended to copy these lines over exactly and limit modifications):
await browser.storage.local.set({a: 123});
await browser.storage.local.set({b: true});
await browser.storage.local.set({c: "test"});
await browser.storage.local.set({d: [1, 2]});
await browser.storage.local.set({e: {f: false}});
await browser.storage.local.set({g: null});

Select the Console panel, and for each of the following non-stringifiable items, verify they are set as “Object” in the Storage panel:

await browser.storage.local.set({map: new Map()});
await browser.storage.local.set({set: new Set()});
await browser.storage.local.set({arrayBuffer: new ArrayBuffer(8)});
await browser.storage.local.set({regexp: /regexp/});
await browser.storage.local.set({bigint: 1n})
await browser.storage.local.set({date: new Date()})

Try out a real world extension and modify some of its settings kept in storage local

  1. In the same profile as before, download Tree Style Tab from https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab/.
  2. Leaving any new tabs that are created from the install open, open the addon toolbox for Tree Style Tab in about:debugging.
  3. Select the Storage panel, and select the extension under "Extension Storage" in the sidebar and note the storage items present.
  • For version 3.1.7, you should see something like:
    • closeParentBehaviorMode: 1
    • configsVersion: 7
    • notifiedFeaturesVersion: 3
  1. In the extension page that opens up, check both checkbox options. Click through the prompts to accept the increased permissions.
  • For version 3.1.7, the Storage panel should now have data such as:
    • closeParentBehaviorMode: 1
    • configsVersion: 7
    • notifiedFeaturesVersion: 3
    • requestingPermissionsNatively: null
    • skipCollapsedTabsForTabSwitchingShortcuts: true

Helpful tips

  • How to clear the test extension’s storage:
    • Since the test extensions are just temporarily installed, simply restart Firefox.
    • Note that you will need to re-install the test extension via about:debugging.
  • What the error, TypeError: CONTENT_SCRIPT_PORT is null means:
    • Make sure you have an http(s):// page loaded in a tab (e.g. https://www.mozilla.org/).
    • If the extension has restarted (e.g. disabled/re-enabled, reloaded…) since the page was loaded, you may need to reload the page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment