| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 7 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
| 8 #include "content/browser/dom_storage/local_storage_context_mojo.h" | 8 #include "content/browser/dom_storage/local_storage_context_mojo.h" |
| 9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
| 10 #include "content/common/dom_storage/dom_storage_types.h" | 10 #include "content/common/dom_storage/dom_storage_types.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // http://crbug.com/654704 PRE_ tests aren't supported on Android. | 91 // http://crbug.com/654704 PRE_ tests aren't supported on Android. |
| 92 #if defined(OS_ANDROID) | 92 #if defined(OS_ANDROID) |
| 93 #define MAYBE_DataPersists DISABLED_DataPersists | 93 #define MAYBE_DataPersists DISABLED_DataPersists |
| 94 #else | 94 #else |
| 95 #define MAYBE_DataPersists DataPersists | 95 #define MAYBE_DataPersists DataPersists |
| 96 #endif | 96 #endif |
| 97 IN_PROC_BROWSER_TEST_F(DOMStorageBrowserTest, MAYBE_DataPersists) { | 97 IN_PROC_BROWSER_TEST_F(DOMStorageBrowserTest, MAYBE_DataPersists) { |
| 98 SimpleTest(GetTestUrl("dom_storage", "verify_data.html"), kNotIncognito); | 98 SimpleTest(GetTestUrl("dom_storage", "verify_data.html"), kNotIncognito); |
| 99 } | 99 } |
| 100 | 100 |
| 101 // http://crbug.com/712872 All the mojo tests are flaky on Mac. | 101 IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, SanityCheck) { |
| 102 #if defined(OS_MACOSX) | |
| 103 #define MAYBE_SanityCheck DISABLED_SanityCheck | |
| 104 #else | |
| 105 #define MAYBE_SanityCheck SanityCheck | |
| 106 #endif | |
| 107 IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, MAYBE_SanityCheck) { | |
| 108 SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kNotIncognito); | 102 SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kNotIncognito); |
| 109 } | 103 } |
| 110 | 104 |
| 111 IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, SanityCheckIncognito) { | 105 IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, SanityCheckIncognito) { |
| 112 SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kIncognito); | 106 SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kIncognito); |
| 113 } | 107 } |
| 114 | 108 |
| 115 IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, PRE_DataPersists) { | 109 IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, PRE_DataPersists) { |
| 116 EnsureConnected(); | 110 EnsureConnected(); |
| 117 SimpleTest(GetTestUrl("dom_storage", "store_data.html"), kNotIncognito); | 111 SimpleTest(GetTestUrl("dom_storage", "store_data.html"), kNotIncognito); |
| 118 Flush(); | 112 Flush(); |
| 119 } | 113 } |
| 120 | 114 |
| 121 // http://crbug.com/712872 All the mojo tests are flaky on Mac. | |
| 122 #if defined(OS_MACOSX) | |
| 123 #undef MAYBE_DataPersists | |
| 124 #define MAYBE_DataPersists DISABLED_DataPersists | |
| 125 #endif | |
| 126 IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, MAYBE_DataPersists) { | 115 IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, MAYBE_DataPersists) { |
| 127 SimpleTest(GetTestUrl("dom_storage", "verify_data.html"), kNotIncognito); | 116 SimpleTest(GetTestUrl("dom_storage", "verify_data.html"), kNotIncognito); |
| 128 } | 117 } |
| 129 | 118 |
| 130 class DOMStorageMigrationBrowserTest : public DOMStorageBrowserTest { | 119 class DOMStorageMigrationBrowserTest : public DOMStorageBrowserTest { |
| 131 public: | 120 public: |
| 132 void SetUpCommandLine(base::CommandLine* command_line) override { | 121 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 133 ContentBrowserTest::SetUpCommandLine(command_line); | 122 ContentBrowserTest::SetUpCommandLine(command_line); |
| 134 // Only enable mojo local storage if this is not a PRE_ test. | 123 // Only enable mojo local storage if this is not a PRE_ test. |
| 135 const testing::TestInfo* test = | 124 const testing::TestInfo* test = |
| 136 testing::UnitTest::GetInstance()->current_test_info(); | 125 testing::UnitTest::GetInstance()->current_test_info(); |
| 137 if (!base::StartsWith(test->name(), "PRE_", base::CompareCase::SENSITIVE)) | 126 if (!base::StartsWith(test->name(), "PRE_", base::CompareCase::SENSITIVE)) |
| 138 command_line->AppendSwitch(switches::kMojoLocalStorage); | 127 command_line->AppendSwitch(switches::kMojoLocalStorage); |
| 139 } | 128 } |
| 140 }; | 129 }; |
| 141 | 130 |
| 142 IN_PROC_BROWSER_TEST_F(DOMStorageMigrationBrowserTest, PRE_DataMigrates) { | 131 IN_PROC_BROWSER_TEST_F(DOMStorageMigrationBrowserTest, PRE_DataMigrates) { |
| 143 SimpleTest(GetTestUrl("dom_storage", "store_data.html"), kNotIncognito); | 132 SimpleTest(GetTestUrl("dom_storage", "store_data.html"), kNotIncognito); |
| 144 } | 133 } |
| 145 | 134 |
| 146 // http://crbug.com/654704 PRE_ tests aren't supported on Android. | 135 // http://crbug.com/654704 PRE_ tests aren't supported on Android. |
| 147 #if defined(OS_ANDROID) | 136 #if defined(OS_ANDROID) |
| 148 #define MAYBE_DataMigrates DISABLED_DataMigrates | 137 #define MAYBE_DataMigrates DISABLED_DataMigrates |
| 149 #elif defined(OS_MACOSX) | |
| 150 // http://crbug.com/712872 All the mojo tests are flaky on Mac. | |
| 151 #define MAYBE_DataMigrates DISABLED_DataMigrates | |
| 152 #else | 138 #else |
| 153 #define MAYBE_DataMigrates DataMigrates | 139 #define MAYBE_DataMigrates DataMigrates |
| 154 #endif | 140 #endif |
| 155 IN_PROC_BROWSER_TEST_F(DOMStorageMigrationBrowserTest, MAYBE_DataMigrates) { | 141 IN_PROC_BROWSER_TEST_F(DOMStorageMigrationBrowserTest, MAYBE_DataMigrates) { |
| 156 SimpleTest(GetTestUrl("dom_storage", "verify_data.html"), kNotIncognito); | 142 SimpleTest(GetTestUrl("dom_storage", "verify_data.html"), kNotIncognito); |
| 157 } | 143 } |
| 158 | 144 |
| 159 } // namespace content | 145 } // namespace content |
| OLD | NEW |