summaryrefslogtreecommitdiffstats
path: root/tools/page_cycler/indexed_db/common.js
blob: d1b4f724008fa5f6545cedf3f9541e73e5ef8b9d (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
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

var CANNOT_OPEN_DB = -1;
var SETUP_FAILED = -2;
var TEST_FAILED = -3;

function setup() {
  if ('webkitIndexedDB' in window) {
    indexedDB = webkitIndexedDB;
    IDBCursor = webkitIDBCursor;
    IDBKeyRange = webkitIDBKeyRange;
    IDBTransaction = webkitIDBTransaction;
    return true;
  }

  if ('indexedDB' in window)
    return true;

  return false;
}

function log(msg) {
  document.write(msg + '<br>');
}