| 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/memory/weak_ptr.h" | 5 #include "base/memory/weak_ptr.h" |
| 6 #include "chrome/browser/platform_util.h" | 6 #include "chrome/browser/platform_util.h" |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/search/search.h" |
| 8 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" | 10 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 11 #include "chrome/browser/ui/views/constrained_window_views.h" | 12 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 12 #include "chrome/browser/ui/views/frame/browser_view.h" | 13 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 13 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" | 14 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
| 14 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
| 15 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
| 16 #include "chrome/test/base/ui_test_utils.h" | 17 #include "chrome/test/base/ui_test_utils.h" |
| 17 #include "components/web_modal/web_contents_modal_dialog_host.h" | 18 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 EXPECT_FALSE(web_contents->GetController().GetPendingEntry()); | 352 EXPECT_FALSE(web_contents->GetController().GetPendingEntry()); |
| 352 EXPECT_EQ(about_url.spec(), web_contents->GetURL().spec()); | 353 EXPECT_EQ(about_url.spec(), web_contents->GetURL().spec()); |
| 353 | 354 |
| 354 // Backspace is processed as accelerator after it's sent to web contents. | 355 // Backspace is processed as accelerator after it's sent to web contents. |
| 355 content::RunAllPendingInMessageLoop(); | 356 content::RunAllPendingInMessageLoop(); |
| 356 EXPECT_TRUE(web_contents->GetController().GetPendingEntry()); | 357 EXPECT_TRUE(web_contents->GetController().GetPendingEntry()); |
| 357 | 358 |
| 358 // Wait for the navigation to commit, since the URL will not be visible | 359 // Wait for the navigation to commit, since the URL will not be visible |
| 359 // until then. | 360 // until then. |
| 360 back_observer.Wait(); | 361 back_observer.Wait(); |
| 361 EXPECT_EQ(new_tab_url.spec(), web_contents->GetURL().spec()); | 362 EXPECT_TRUE(chrome::IsNTPURL(web_contents->GetURL(), browser()->profile())); |
| 362 } | 363 } |
| 363 | 364 |
| 364 // Fails flakily (once per 10-20 runs) on Win Aura only. http://crbug.com/177482 | 365 // Fails flakily (once per 10-20 runs) on Win Aura only. http://crbug.com/177482 |
| 365 // Also fails on CrOS. | 366 // Also fails on CrOS. |
| 366 #if defined(OS_WIN) || defined(OS_CHROMEOS) | 367 #if defined(OS_WIN) || defined(OS_CHROMEOS) |
| 367 #define MAYBE_EscapeCloseConstrainedWindow DISABLED_EscapeCloseConstrainedWindow | 368 #define MAYBE_EscapeCloseConstrainedWindow DISABLED_EscapeCloseConstrainedWindow |
| 368 #else | 369 #else |
| 369 #define MAYBE_EscapeCloseConstrainedWindow EscapeCloseConstrainedWindow | 370 #define MAYBE_EscapeCloseConstrainedWindow EscapeCloseConstrainedWindow |
| 370 #endif | 371 #endif |
| 371 | 372 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 395 // Escape is not processed as accelerator before it's sent to web contents. | 396 // Escape is not processed as accelerator before it's sent to web contents. |
| 396 EXPECT_FALSE(observer.widget_closed()); | 397 EXPECT_FALSE(observer.widget_closed()); |
| 397 | 398 |
| 398 content::RunAllPendingInMessageLoop(); | 399 content::RunAllPendingInMessageLoop(); |
| 399 | 400 |
| 400 // Escape is processed as accelerator after it's sent to web contents. | 401 // Escape is processed as accelerator after it's sent to web contents. |
| 401 EXPECT_TRUE(observer.widget_closed()); | 402 EXPECT_TRUE(observer.widget_closed()); |
| 402 } | 403 } |
| 403 | 404 |
| 404 #endif // defined(OS_WIN) || (defined(USE_AURA) && defined(USE_X11)) | 405 #endif // defined(OS_WIN) || (defined(USE_AURA) && defined(USE_X11)) |
| OLD | NEW |