| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/gfx/native_widget_types.h" | 6 #include "base/gfx/native_widget_types.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(0); | 229 scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(0); |
| 230 ASSERT_TRUE(browser.get()); | 230 ASSERT_TRUE(browser.get()); |
| 231 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); | 231 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); |
| 232 ASSERT_TRUE(tab.get()); | 232 ASSERT_TRUE(tab.get()); |
| 233 std::wstring title; | 233 std::wstring title; |
| 234 ASSERT_TRUE(tab->GetTabTitle(&title)); | 234 ASSERT_TRUE(tab->GetTabTitle(&title)); |
| 235 ASSERT_EQ(L"SUCCESS", title); | 235 ASSERT_EQ(L"SUCCESS", title); |
| 236 } | 236 } |
| 237 #endif | 237 #endif |
| 238 | 238 |
| 239 class SecurityTest : public UITest { |
| 240 protected: |
| 241 static const int kTestIntervalMs = 250; |
| 242 static const int kTestWaitTimeoutMs = 60 * 1000; |
| 243 }; |
| 244 |
| 245 TEST_F(SecurityTest, DisallowFileUrlUniversalAccessTest) { |
| 246 scoped_refptr<TabProxy> tab(GetActiveTab()); |
| 247 ASSERT_TRUE(tab.get()); |
| 248 |
| 249 FilePath test_file(test_data_directory_); |
| 250 test_file = test_file.AppendASCII("fileurl_universalaccess.html"); |
| 251 |
| 252 GURL url = net::FilePathToFileURL(test_file); |
| 253 ASSERT_TRUE(tab->NavigateToURL(url)); |
| 254 |
| 255 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, |
| 256 "status", kTestIntervalMs, kTestWaitTimeoutMs); |
| 257 ASSERT_STREQ("Disallowed", value.c_str()); |
| 258 } |
| 259 |
| 239 } // namespace | 260 } // namespace |
| OLD | NEW |