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" | |
9 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
12 #include "chrome/browser/ui/views/constrained_window_views.h" | 11 #include "chrome/browser/ui/views/constrained_window_views.h" |
13 #include "chrome/browser/ui/views/frame/browser_view.h" | 12 #include "chrome/browser/ui/views/frame/browser_view.h" |
14 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" | 13 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
15 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
16 #include "chrome/test/base/in_process_browser_test.h" | 15 #include "chrome/test/base/in_process_browser_test.h" |
17 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
18 #include "components/web_modal/web_contents_modal_dialog_host.h" | 17 #include "components/web_modal/web_contents_modal_dialog_host.h" |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 EXPECT_FALSE(web_contents->GetController().GetPendingEntry()); | 402 EXPECT_FALSE(web_contents->GetController().GetPendingEntry()); |
404 EXPECT_EQ(about_url.spec(), web_contents->GetURL().spec()); | 403 EXPECT_EQ(about_url.spec(), web_contents->GetURL().spec()); |
405 | 404 |
406 // Backspace is processed as accelerator after it's sent to web contents. | 405 // Backspace is processed as accelerator after it's sent to web contents. |
407 content::RunAllPendingInMessageLoop(); | 406 content::RunAllPendingInMessageLoop(); |
408 EXPECT_TRUE(web_contents->GetController().GetPendingEntry()); | 407 EXPECT_TRUE(web_contents->GetController().GetPendingEntry()); |
409 | 408 |
410 // Wait for the navigation to commit, since the URL will not be visible | 409 // Wait for the navigation to commit, since the URL will not be visible |
411 // until then. | 410 // until then. |
412 back_observer.Wait(); | 411 back_observer.Wait(); |
413 EXPECT_TRUE(chrome::IsNTPURL(web_contents->GetURL(), browser()->profile())); | 412 EXPECT_EQ(new_tab_url.spec(), web_contents->GetURL().spec()); |
414 } | 413 } |
415 | 414 |
416 // Fails flakily (once per 10-20 runs) on Win Aura only. http://crbug.com/177482 | 415 // Fails flakily (once per 10-20 runs) on Win Aura only. http://crbug.com/177482 |
417 // Also fails on CrOS. | 416 // Also fails on CrOS. |
418 #if defined(OS_WIN) || defined(OS_CHROMEOS) | 417 #if defined(OS_WIN) || defined(OS_CHROMEOS) |
419 #define MAYBE_EscapeCloseConstrainedWindow DISABLED_EscapeCloseConstrainedWindow | 418 #define MAYBE_EscapeCloseConstrainedWindow DISABLED_EscapeCloseConstrainedWindow |
420 #else | 419 #else |
421 #define MAYBE_EscapeCloseConstrainedWindow EscapeCloseConstrainedWindow | 420 #define MAYBE_EscapeCloseConstrainedWindow EscapeCloseConstrainedWindow |
422 #endif | 421 #endif |
423 | 422 |
(...skipping 23 matching lines...) Expand all Loading... |
447 // Escape is not processed as accelerator before it's sent to web contents. | 446 // Escape is not processed as accelerator before it's sent to web contents. |
448 EXPECT_FALSE(observer.widget_closed()); | 447 EXPECT_FALSE(observer.widget_closed()); |
449 | 448 |
450 content::RunAllPendingInMessageLoop(); | 449 content::RunAllPendingInMessageLoop(); |
451 | 450 |
452 // Escape is processed as accelerator after it's sent to web contents. | 451 // Escape is processed as accelerator after it's sent to web contents. |
453 EXPECT_TRUE(observer.widget_closed()); | 452 EXPECT_TRUE(observer.widget_closed()); |
454 } | 453 } |
455 | 454 |
456 #endif // defined(OS_WIN) || (defined(USE_AURA) && defined(USE_X11)) | 455 #endif // defined(OS_WIN) || (defined(USE_AURA) && defined(USE_X11)) |
OLD | NEW |