| 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 "base/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "chrome/common/chrome_switches.h" | 6 #include "chrome/common/chrome_switches.h" |
| 7 #include "chrome/test/automation/tab_proxy.h" | 7 #include "chrome/test/automation/tab_proxy.h" |
| 8 #include "chrome/test/ui/ui_layout_test.h" | 8 #include "chrome/test/ui/ui_layout_test.h" |
| 9 #include "chrome/test/ui_test_utils.h" | 9 #include "chrome/test/ui_test_utils.h" |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 "simple-usage.html", | 35 "simple-usage.html", |
| 36 "string-conversion.html", | 36 "string-conversion.html", |
| 37 // "window-open.html", // TODO(jorlow): Fix | 37 // "window-open.html", // TODO(jorlow): Fix |
| 38 NULL | 38 NULL |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 class DOMStorageTest : public UILayoutTest { | 41 class DOMStorageTest : public UILayoutTest { |
| 42 protected: | 42 protected: |
| 43 DOMStorageTest() | 43 DOMStorageTest() |
| 44 : UILayoutTest(), | 44 : UILayoutTest(), |
| 45 test_dir_(FilePath().AppendASCII("LayoutTests"). | 45 test_dir_(FilePath(). |
| 46 AppendASCII("storage").AppendASCII("domstorage")) { | 46 AppendASCII("storage").AppendASCII("domstorage")) { |
| 47 } | 47 } |
| 48 | 48 |
| 49 virtual ~DOMStorageTest() { } | 49 virtual ~DOMStorageTest() { } |
| 50 | 50 |
| 51 virtual void SetUp() { | 51 virtual void SetUp() { |
| 52 launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking); | 52 launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking); |
| 53 UILayoutTest::SetUp(); | 53 UILayoutTest::SetUp(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 // We require fast/js/resources for most of the DOM Storage layout tests. | 56 // We require fast/js/resources for most of the DOM Storage layout tests. |
| 57 // Add those to the list to be copied. | 57 // Add those to the list to be copied. |
| 58 void AddJSTestResources() { | 58 void AddJSTestResources() { |
| 59 // Add other paths our tests require. | 59 // Add other paths our tests require. |
| 60 FilePath js_dir = FilePath().AppendASCII("LayoutTests"). | 60 FilePath js_dir = FilePath(). |
| 61 AppendASCII("fast").AppendASCII("js"); | 61 AppendASCII("fast").AppendASCII("js"); |
| 62 AddResourceForLayoutTest(js_dir, FilePath().AppendASCII("resources")); | 62 AddResourceForLayoutTest(js_dir, FilePath().AppendASCII("resources")); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // This is somewhat of a hack because we're running a real browser that | 65 // This is somewhat of a hack because we're running a real browser that |
| 66 // actually persists the LocalStorage state vs. DRT and TestShell which don't. | 66 // actually persists the LocalStorage state vs. DRT and TestShell which don't. |
| 67 // The correct fix is to fix the LayoutTests, but similar patches have been | 67 // The correct fix is to fix the LayoutTests, but similar patches have been |
| 68 // rejected in the past. | 68 // rejected in the past. |
| 69 void ClearDOMStorage() { | 69 void ClearDOMStorage() { |
| 70 scoped_refptr<TabProxy> tab(GetActiveTab()); | 70 scoped_refptr<TabProxy> tab(GetActiveTab()); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } | 120 } |
| 121 | 121 |
| 122 TEST_F(DOMStorageTest, SessionStorageLayoutTests) { | 122 TEST_F(DOMStorageTest, SessionStorageLayoutTests) { |
| 123 InitializeForLayoutTest(test_dir_, FilePath().AppendASCII("sessionstorage"), | 123 InitializeForLayoutTest(test_dir_, FilePath().AppendASCII("sessionstorage"), |
| 124 kNoHttpPort); | 124 kNoHttpPort); |
| 125 AddJSTestResources(); | 125 AddJSTestResources(); |
| 126 AddResourceForLayoutTest(test_dir_, FilePath().AppendASCII("sessionstorage"). | 126 AddResourceForLayoutTest(test_dir_, FilePath().AppendASCII("sessionstorage"). |
| 127 AppendASCII("resources")); | 127 AppendASCII("resources")); |
| 128 RunTests(kStorageFiles); | 128 RunTests(kStorageFiles); |
| 129 } | 129 } |
| OLD | NEW |