OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/common/chrome_switches.h" |
| 6 #include "chrome/test/ui/ui_layout_test.h" |
| 7 |
| 8 // TODO(jorlow): Enable these tests when we remove them from the |
| 9 // test_exceptions.txt file. |
| 10 //static const char* kTopLevelFiles[] = { |
| 11 //"window-attributes-exist.html" |
| 12 //}; |
| 13 |
| 14 // TODO(jorlow): Enable these tests when we remove them from the |
| 15 // test_exceptions.txt file. |
| 16 static const char* kSubDirFiles[] = { |
| 17 "clear.html", |
| 18 "delete-removal.html", |
| 19 "enumerate-storage.html", |
| 20 "enumerate-with-length-and-key.html", |
| 21 //"iframe-events.html", |
| 22 //"index-get-and-set.html", |
| 23 //"onstorage-attribute-markup.html", |
| 24 //"onstorage-attribute-setattribute.html", |
| 25 //"localstorage/onstorage-attribute-setwindow.html", |
| 26 //"simple-events.html", |
| 27 "simple-usage.html", |
| 28 //"string-conversion.html", |
| 29 // "window-open.html" |
| 30 }; |
| 31 |
| 32 class DOMStorageTest : public UILayoutTest { |
| 33 protected: |
| 34 DOMStorageTest() |
| 35 : UILayoutTest(), |
| 36 test_dir_(FilePath().AppendASCII("LayoutTests"). |
| 37 AppendASCII("storage").AppendASCII("domstorage")) |
| 38 { |
| 39 } |
| 40 |
| 41 virtual ~DOMStorageTest() { } |
| 42 |
| 43 virtual void SetUp() { |
| 44 launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking); |
| 45 launch_arguments_.AppendSwitch(switches::kEnableLocalStorage); |
| 46 launch_arguments_.AppendSwitch(switches::kEnableSessionStorage); |
| 47 UILayoutTest::SetUp(); |
| 48 } |
| 49 |
| 50 FilePath test_dir_; |
| 51 }; |
| 52 |
| 53 TEST_F(DOMStorageTest, DOMStorageLayoutTests) { |
| 54 // TODO(jorlow): Enable these tests when we remove them from the |
| 55 // test_exceptions.txt file. |
| 56 //InitializeForLayoutTest(test_dir_, FilePath(), false); |
| 57 //for (size_t i=0; i<arraysize(kTopLevelFiles); ++i) |
| 58 // RunLayoutTest(kTopLevelFiles[i], false, true); |
| 59 } |
| 60 |
| 61 TEST_F(DOMStorageTest, LocalStorageLayoutTests) { |
| 62 InitializeForLayoutTest(test_dir_, FilePath().AppendASCII("localstorage"), |
| 63 false); |
| 64 for (size_t i=0; i<arraysize(kSubDirFiles); ++i) |
| 65 RunLayoutTest(kSubDirFiles[i], false); |
| 66 } |
| 67 |
| 68 TEST_F(DOMStorageTest, SessionStorageLayoutTests) { |
| 69 InitializeForLayoutTest(test_dir_, FilePath().AppendASCII("sessionstorage"), |
| 70 false); |
| 71 for (size_t i=0; i<arraysize(kSubDirFiles); ++i) |
| 72 RunLayoutTest(kSubDirFiles[i], false); |
| 73 } |
OLD | NEW |