| 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 "content/browser/web_contents/web_contents_impl.h" | 6 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 #include "content/common/dom_storage/dom_storage_types.h" | 7 #include "content/common/dom_storage/dom_storage_types.h" |
| 7 #include "content/public/common/content_paths.h" | 8 #include "content/public/common/content_paths.h" |
| 9 #include "content/public/common/content_switches.h" |
| 8 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
| 9 #include "content/public/test/content_browser_test.h" | 11 #include "content/public/test/content_browser_test.h" |
| 10 #include "content/public/test/content_browser_test_utils.h" | 12 #include "content/public/test/content_browser_test_utils.h" |
| 11 #include "content/shell/browser/shell.h" | 13 #include "content/shell/browser/shell.h" |
| 12 | 14 |
| 13 namespace content { | 15 namespace content { |
| 14 | 16 |
| 15 // This browser test is aimed towards exercising the DOMStorage system | 17 // This browser test is aimed towards exercising the DOMStorage system |
| 16 // from end-to-end. | 18 // from end-to-end. |
| 17 class DOMStorageBrowserTest : public ContentBrowserTest { | 19 class DOMStorageBrowserTest : public ContentBrowserTest { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 29 std::string js_result; | 31 std::string js_result; |
| 30 ASSERT_TRUE(ExecuteScriptAndExtractString( | 32 ASSERT_TRUE(ExecuteScriptAndExtractString( |
| 31 the_browser->web_contents(), | 33 the_browser->web_contents(), |
| 32 "window.domAutomationController.send(getLog())", | 34 "window.domAutomationController.send(getLog())", |
| 33 &js_result)); | 35 &js_result)); |
| 34 FAIL() << "Failed: " << js_result; | 36 FAIL() << "Failed: " << js_result; |
| 35 } | 37 } |
| 36 } | 38 } |
| 37 }; | 39 }; |
| 38 | 40 |
| 41 class MojoDOMStorageBrowserTest : public DOMStorageBrowserTest { |
| 42 public: |
| 43 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 44 ContentBrowserTest::SetUpCommandLine(command_line); |
| 45 command_line->AppendSwitch(switches::kMojoLocalStorage); |
| 46 } |
| 47 }; |
| 48 |
| 39 static const bool kIncognito = true; | 49 static const bool kIncognito = true; |
| 40 static const bool kNotIncognito = false; | 50 static const bool kNotIncognito = false; |
| 41 | 51 |
| 42 IN_PROC_BROWSER_TEST_F(DOMStorageBrowserTest, SanityCheck) { | 52 IN_PROC_BROWSER_TEST_F(DOMStorageBrowserTest, SanityCheck) { |
| 43 SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kNotIncognito); | 53 SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kNotIncognito); |
| 44 } | 54 } |
| 45 | 55 |
| 46 IN_PROC_BROWSER_TEST_F(DOMStorageBrowserTest, SanityCheckIncognito) { | 56 IN_PROC_BROWSER_TEST_F(DOMStorageBrowserTest, SanityCheckIncognito) { |
| 47 SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kIncognito); | 57 SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kIncognito); |
| 48 } | 58 } |
| 49 | 59 |
| 60 // TODO(michaeln): Enable the mojo tests after crbug/608121 is fixed. |
| 61 IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, DISABLED_SanityCheck) { |
| 62 SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kNotIncognito); |
| 63 } |
| 64 |
| 65 IN_PROC_BROWSER_TEST_F(MojoDOMStorageBrowserTest, |
| 66 DISABLED_SanityCheckIncognito) { |
| 67 SimpleTest(GetTestUrl("dom_storage", "sanity_check.html"), kIncognito); |
| 68 } |
| 69 |
| 50 } // namespace content | 70 } // namespace content |
| OLD | NEW |