summaryrefslogtreecommitdiffstats
path: root/chrome/browser/in_process_webkit/dom_storage_uitest.cc
blob: 182867969b7c3449d861edfe74e11e937f74ed5d (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright (c) 2009 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.

#include "chrome/common/chrome_switches.h"
#include "chrome/test/ui/ui_layout_test.h"

// TODO(jorlow): Enable these tests when we remove them from the
//               test_exceptions.txt file.
//static const char* kTopLevelFiles[] = {
  //"window-attributes-exist.html"
//};

// TODO(jorlow): Enable these tests when we remove them from the
//               test_exceptions.txt file.
static const char* kSubDirFiles[] = {
  //"clear.html",
  "delete-removal.html",
  "enumerate-storage.html",
  "enumerate-with-length-and-key.html",
  //"iframe-events.html",
  //"index-get-and-set.html",
  //"onstorage-attribute-markup.html",
  //"onstorage-attribute-setattribute.html",
  //"localstorage/onstorage-attribute-setwindow.html",
  //"simple-events.html",
  "simple-usage.html",
  //"string-conversion.html",
  //"window-open.html"
};

class DOMStorageTest : public UILayoutTest {
 protected:
  DOMStorageTest()
      : UILayoutTest(),
        test_dir_(FilePath().AppendASCII("LayoutTests").
                  AppendASCII("storage").AppendASCII("domstorage"))
  {
  }

  virtual ~DOMStorageTest() { }

  virtual void SetUp() {
    launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking);
    launch_arguments_.AppendSwitch(switches::kEnableLocalStorage);
    launch_arguments_.AppendSwitch(switches::kEnableSessionStorage);
    UILayoutTest::SetUp();
  }

  FilePath test_dir_;
};

TEST_F(DOMStorageTest, DOMStorageLayoutTests) {
  // TODO(jorlow): Enable these tests when we remove them from the
  //               test_exceptions.txt file.
  //InitializeForLayoutTest(test_dir_, FilePath(), false);
  //for (size_t i=0; i<arraysize(kTopLevelFiles); ++i)
  //  RunLayoutTest(kTopLevelFiles[i], false, true);
}

TEST_F(DOMStorageTest, LocalStorageLayoutTests) {
  InitializeForLayoutTest(test_dir_, FilePath().AppendASCII("localstorage"),
                          false);
  for (size_t i=0; i<arraysize(kSubDirFiles); ++i)
    RunLayoutTest(kSubDirFiles[i], false);
}

TEST_F(DOMStorageTest, SessionStorageLayoutTests) {
  InitializeForLayoutTest(test_dir_, FilePath().AppendASCII("sessionstorage"),
                          false);
  for (size_t i=0; i<arraysize(kSubDirFiles); ++i)
    RunLayoutTest(kSubDirFiles[i], false);
}