OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <sstream> | 5 #include <sstream> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 ASSERT_TRUE(tab.get()); | 174 ASSERT_TRUE(tab.get()); |
175 | 175 |
176 GURL url(test_server.GetURL("files/onunload_cookie.html")); | 176 GURL url(test_server.GetURL("files/onunload_cookie.html")); |
177 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(url)); | 177 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(url)); |
178 | 178 |
179 // Confirm that the page has loaded (since it changes its title during load). | 179 // Confirm that the page has loaded (since it changes its title during load). |
180 std::wstring tab_title; | 180 std::wstring tab_title; |
181 EXPECT_TRUE(tab->GetTabTitle(&tab_title)); | 181 EXPECT_TRUE(tab->GetTabTitle(&tab_title)); |
182 EXPECT_EQ(L"set cookie on unload", tab_title); | 182 EXPECT_EQ(L"set cookie on unload", tab_title); |
183 | 183 |
184 // Navigate to a new cross-site page, to dispatch unload event and set the | 184 // Navigate to a new cross-site page, to dispatch unload event and set theq |
185 // cookie. | 185 // cookie. |
186 CheckTitleTest("content-sniffer-test0.html", | 186 CheckTitleTest("content-sniffer-test0.html", |
187 "Content Sniffer Test 0", 1); | 187 "Content Sniffer Test 0", 1); |
188 | 188 |
189 // Check that the cookie was set. | 189 // Check that the cookie was set. |
190 std::string value_result; | 190 std::string value_result; |
191 ASSERT_TRUE(tab->GetCookieByName(url, "onunloadCookie", &value_result)); | 191 ASSERT_TRUE(tab->GetCookieByName(url, "onunloadCookie", &value_result)); |
192 ASSERT_FALSE(value_result.empty()); | 192 ASSERT_FALSE(value_result.empty()); |
193 ASSERT_STREQ("foo", value_result.c_str()); | 193 ASSERT_STREQ("foo", value_result.c_str()); |
194 } | 194 } |
195 | 195 |
196 #if !defined(OS_MACOSX) | 196 #if !defined(OS_MACOSX) |
197 // Tests that the onbeforeunload and onunload logic is shortcutted if the old | 197 // Tests that the onbeforeunload and onunload logic is shortcutted if the old |
198 // renderer is gone. In that case, we don't want to wait for the old renderer | 198 // renderer is gone. In that case, we don't want to wait for the old renderer |
199 // to run the handlers. | 199 // to run the handlers. |
200 // We need to disable this on Mac because the crash causes the OS CrashReporter | 200 // We need to disable this on Mac because the crash causes the OS CrashReporter |
201 // process to kick in to analyze the poor dead renderer. Unfortunately, if the | 201 // process to kick in to analyze the poor dead renderer. Unfortunately, if the |
202 // app isn't stripped of debug symbols, this takes about five minutes to | 202 // app isn't stripped of debug symbols, this takes about five minutes to |
203 // complete and isn't conducive to quick turnarounds. As we don't currently | 203 // complete and isn't conducive to quick turnarounds. As we don't currently |
204 // strip the app on the build bots, this is bad times. | 204 // strip the app on the build bots, this is bad times. |
205 TEST_F(ResourceDispatcherTest, CrossSiteAfterCrash) { | 205 TEST_F(ResourceDispatcherTest, FAILS_CrossSiteAfterCrash) { |
206 // This test only works in multi-process mode | 206 // This test only works in multi-process mode |
207 if (ProxyLauncher::in_process_renderer()) | 207 if (ProxyLauncher::in_process_renderer()) |
208 return; | 208 return; |
209 | 209 |
210 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); | 210 scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); |
211 ASSERT_TRUE(browser_proxy.get()); | 211 ASSERT_TRUE(browser_proxy.get()); |
212 scoped_refptr<TabProxy> tab(browser_proxy->GetActiveTab()); | 212 scoped_refptr<TabProxy> tab(browser_proxy->GetActiveTab()); |
213 ASSERT_TRUE(tab.get()); | 213 ASSERT_TRUE(tab.get()); |
214 | 214 |
215 // Cause the renderer to crash. | 215 // Cause the renderer to crash. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 GURL broken_url("chrome://theme"); | 328 GURL broken_url("chrome://theme"); |
329 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(broken_url)); | 329 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(broken_url)); |
330 | 330 |
331 // Make sure the navigation finishes. | 331 // Make sure the navigation finishes. |
332 std::wstring tab_title; | 332 std::wstring tab_title; |
333 EXPECT_TRUE(tab->GetTabTitle(&tab_title)); | 333 EXPECT_TRUE(tab->GetTabTitle(&tab_title)); |
334 EXPECT_EQ(L"chrome://theme/ is not available", tab_title); | 334 EXPECT_EQ(L"chrome://theme/ is not available", tab_title); |
335 } | 335 } |
336 | 336 |
337 } // namespace | 337 } // namespace |
OLD | NEW |