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