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/path_service.h" | 5 #include "base/path_service.h" |
6 #include "chrome/browser/ui/browser.h" | 6 #include "chrome/browser/ui/browser.h" |
7 #include "chrome/browser/ui/browser_tabstrip.h" | 7 #include "chrome/browser/ui/browser_tabstrip.h" |
8 #include "chrome/test/base/in_process_browser_test.h" | 8 #include "chrome/test/base/in_process_browser_test.h" |
9 #include "chrome/test/base/ui_test_utils.h" | 9 #include "chrome/test/base/ui_test_utils.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
11 #include "content/public/common/content_paths.h" | 11 #include "content/public/common/content_paths.h" |
12 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
13 #include "webkit/dom_storage/dom_storage_types.h" | 13 #include "webkit/dom_storage/dom_storage_types.h" |
14 | 14 |
15 // This browser test is aimed towards exercising the DomStorage system | 15 // This browser test is aimed towards exercising the DomStorage system |
16 // from end-to-end. | 16 // from end-to-end. |
17 class DomStorageBrowserTest : public InProcessBrowserTest { | 17 class DomStorageBrowserTest : public InProcessBrowserTest { |
18 public: | 18 public: |
19 DomStorageBrowserTest() { | 19 DomStorageBrowserTest() {} |
20 EnableDOMAutomation(); | |
21 } | |
22 | 20 |
23 GURL GetTestURL(const char* name) { | 21 GURL GetTestURL(const char* name) { |
24 FilePath file_name = FilePath().AppendASCII(name); | 22 FilePath file_name = FilePath().AppendASCII(name); |
25 FilePath dir; | 23 FilePath dir; |
26 PathService::Get(content::DIR_TEST_DATA, &dir); | 24 PathService::Get(content::DIR_TEST_DATA, &dir); |
27 return net::FilePathToFileURL( | 25 return net::FilePathToFileURL( |
28 dir.Append(FILE_PATH_LITERAL("dom_storage")).Append(file_name)); | 26 dir.Append(FILE_PATH_LITERAL("dom_storage")).Append(file_name)); |
29 } | 27 } |
30 | 28 |
31 void SimpleTest(const GURL& test_url, bool incognito) { | 29 void SimpleTest(const GURL& test_url, bool incognito) { |
(...skipping 17 matching lines...) Expand all Loading... |
49 static const bool kIncognito = true; | 47 static const bool kIncognito = true; |
50 static const bool kNotIncognito = false; | 48 static const bool kNotIncognito = false; |
51 | 49 |
52 IN_PROC_BROWSER_TEST_F(DomStorageBrowserTest, SanityCheck) { | 50 IN_PROC_BROWSER_TEST_F(DomStorageBrowserTest, SanityCheck) { |
53 SimpleTest(GetTestURL("sanity_check.html"), kNotIncognito); | 51 SimpleTest(GetTestURL("sanity_check.html"), kNotIncognito); |
54 } | 52 } |
55 | 53 |
56 IN_PROC_BROWSER_TEST_F(DomStorageBrowserTest, SanityCheckIncognito) { | 54 IN_PROC_BROWSER_TEST_F(DomStorageBrowserTest, SanityCheckIncognito) { |
57 SimpleTest(GetTestURL("sanity_check.html"), kIncognito); | 55 SimpleTest(GetTestURL("sanity_check.html"), kIncognito); |
58 } | 56 } |
OLD | NEW |