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 "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 test_files.push_back("session_storage.html"); | 120 test_files.push_back("session_storage.html"); |
121 base::FilePath test_file_dir; | 121 base::FilePath test_file_dir; |
122 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &test_file_dir)); | 122 CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &test_file_dir)); |
123 test_file_dir = | 123 test_file_dir = |
124 test_file_dir.AppendASCII("chrome/test/data").AppendASCII(test_path_); | 124 test_file_dir.AppendASCII("chrome/test/data").AppendASCII(test_path_); |
125 | 125 |
126 for (std::vector<std::string>::const_iterator it = test_files.begin(); | 126 for (std::vector<std::string>::const_iterator it = test_files.begin(); |
127 it != test_files.end(); ++it) { | 127 it != test_files.end(); ++it) { |
128 base::FilePath path = test_file_dir.AppendASCII(*it); | 128 base::FilePath path = test_file_dir.AppendASCII(*it); |
129 std::string contents; | 129 std::string contents; |
130 CHECK(file_util::ReadFileToString(path, &contents)); | 130 CHECK(base::ReadFileToString(path, &contents)); |
131 g_file_contents.Get()["/" + test_path_ + *it] = contents; | 131 g_file_contents.Get()["/" + test_path_ + *it] = contents; |
132 net::URLRequestFilter::GetInstance()->AddUrlHandler( | 132 net::URLRequestFilter::GetInstance()->AddUrlHandler( |
133 GURL(fake_server_address_ + test_path_ + *it), | 133 GURL(fake_server_address_ + test_path_ + *it), |
134 &URLRequestFaker); | 134 &URLRequestFaker); |
135 } | 135 } |
136 net::URLRequestFilter::GetInstance()->AddUrlHandler( | 136 net::URLRequestFilter::GetInstance()->AddUrlHandler( |
137 GURL(fake_server_address_ + test_path_ + "posted.php"), | 137 GURL(fake_server_address_ + test_path_ + "posted.php"), |
138 &URLRequestFakerForPostRequests); | 138 &URLRequestFakerForPostRequests); |
139 } | 139 } |
140 | 140 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); | 524 SetDefaultCookieSetting(CONTENT_SETTING_SESSION_ONLY); |
525 } | 525 } |
526 | 526 |
527 IN_PROC_BROWSER_TEST_F(NoSessionRestoreTest, CookiesClearedOnExit) { | 527 IN_PROC_BROWSER_TEST_F(NoSessionRestoreTest, CookiesClearedOnExit) { |
528 content::WebContents* web_contents = | 528 content::WebContents* web_contents = |
529 browser()->tab_strip_model()->GetActiveWebContents(); | 529 browser()->tab_strip_model()->GetActiveWebContents(); |
530 EXPECT_EQ(std::string(content::kAboutBlankURL), | 530 EXPECT_EQ(std::string(content::kAboutBlankURL), |
531 web_contents->GetURL().spec()); | 531 web_contents->GetURL().spec()); |
532 StoreDataWithPage("local_storage.html"); | 532 StoreDataWithPage("local_storage.html"); |
533 } | 533 } |
OLD | NEW |