OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 } | 253 } |
254 | 254 |
255 // Test for crbug.com/22004. Reloading a page with a before unload handler and | 255 // Test for crbug.com/22004. Reloading a page with a before unload handler and |
256 // then canceling the dialog should not leave the throbber spinning. | 256 // then canceling the dialog should not leave the throbber spinning. |
257 IN_PROC_BROWSER_TEST_F(BrowserTest, ReloadThenCancelBeforeUnload) { | 257 IN_PROC_BROWSER_TEST_F(BrowserTest, ReloadThenCancelBeforeUnload) { |
258 GURL url("data:text/html," + BEFORE_UNLOAD_HTML); | 258 GURL url("data:text/html," + BEFORE_UNLOAD_HTML); |
259 ui_test_utils::NavigateToURL(browser(), url); | 259 ui_test_utils::NavigateToURL(browser(), url); |
260 | 260 |
261 // Navigate to another page, but click cancel in the dialog. Make sure that | 261 // Navigate to another page, but click cancel in the dialog. Make sure that |
262 // the throbber stops spinning. | 262 // the throbber stops spinning. |
263 browser()->Reload(); | 263 browser()->Reload(CURRENT_TAB); |
264 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); | 264 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); |
265 alert->CloseModalDialog(); | 265 alert->CloseModalDialog(); |
266 EXPECT_FALSE(browser()->GetSelectedTabContents()->is_loading()); | 266 EXPECT_FALSE(browser()->GetSelectedTabContents()->is_loading()); |
267 | 267 |
268 // Clear the beforeunload handler so the test can easily exit. | 268 // Clear the beforeunload handler so the test can easily exit. |
269 browser()->GetSelectedTabContents()->render_view_host()-> | 269 browser()->GetSelectedTabContents()->render_view_host()-> |
270 ExecuteJavascriptInWebFrame(L"", L"onbeforeunload=null;"); | 270 ExecuteJavascriptInWebFrame(L"", L"onbeforeunload=null;"); |
271 } | 271 } |
272 | 272 |
273 // Crashy on mac. http://crbug.com/40150 | 273 // Crashy on mac. http://crbug.com/40150 |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 // Open the app. Focus should move to the panel. | 872 // Open the app. Focus should move to the panel. |
873 Browser::OpenApplication(profile_, extension_app_->id()); | 873 Browser::OpenApplication(profile_, extension_app_->id()); |
874 ASSERT_EQ(extra_browser, BrowserList::GetLastActive()); | 874 ASSERT_EQ(extra_browser, BrowserList::GetLastActive()); |
875 ASSERT_EQ(2, extra_browser->tab_count()); | 875 ASSERT_EQ(2, extra_browser->tab_count()); |
876 | 876 |
877 browser()->window()->Show(); | 877 browser()->window()->Show(); |
878 Browser::OpenApplication(profile_, extension_app_->id()); | 878 Browser::OpenApplication(profile_, extension_app_->id()); |
879 ASSERT_EQ(browser(), BrowserList::GetLastActive()); | 879 ASSERT_EQ(browser(), BrowserList::GetLastActive()); |
880 ASSERT_EQ(2, browser()->tab_count()); | 880 ASSERT_EQ(2, browser()->tab_count()); |
881 } | 881 } |
OLD | NEW |