summaryrefslogtreecommitdiffstats
path: root/dom/indexedDB/test/unit/test_bad_origin_directory.js
blob: 65943d05467943d1c6db16b6211e07a08ef471df (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
25
26
27
28
29
/**
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */

/* exported testGenerator */
var testGenerator = testSteps();

function* testSteps() {
  const url = "ws://ws.example.com";
  const name = "test_bad_origin_directory.js";

  let uri = Services.io.newURI(url);

  let principal = Services.scriptSecurityManager.createContentPrincipal(
    uri,
    {}
  );

  info("Opening database");

  let request = indexedDB.openForPrincipal(principal, name);
  request.onerror = continueToNextStepSync;
  request.onsuccess = unexpectedSuccessHandler;
  yield undefined;

  finishTest();
  yield undefined;
}