Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Side by Side Diff: chrome/browser/ui/views/constrained_window_views_browsertest.cc

Issue 23789005: (Try 2) Update chrome://newtab checks in browser tests to use chrome::IsNTPURL(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert startup_browser_creator_browsertest changes Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_navigator_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 EXPECT_FALSE(web_contents->GetController().GetPendingEntry()); 403 EXPECT_FALSE(web_contents->GetController().GetPendingEntry());
403 EXPECT_EQ(about_url.spec(), web_contents->GetURL().spec()); 404 EXPECT_EQ(about_url.spec(), web_contents->GetURL().spec());
404 405
405 // Backspace is processed as accelerator after it's sent to web contents. 406 // Backspace is processed as accelerator after it's sent to web contents.
406 content::RunAllPendingInMessageLoop(); 407 content::RunAllPendingInMessageLoop();
407 EXPECT_TRUE(web_contents->GetController().GetPendingEntry()); 408 EXPECT_TRUE(web_contents->GetController().GetPendingEntry());
408 409
409 // Wait for the navigation to commit, since the URL will not be visible 410 // Wait for the navigation to commit, since the URL will not be visible
410 // until then. 411 // until then.
411 back_observer.Wait(); 412 back_observer.Wait();
412 EXPECT_EQ(new_tab_url.spec(), web_contents->GetURL().spec()); 413 EXPECT_TRUE(chrome::IsNTPURL(web_contents->GetURL(), browser()->profile()));
413 } 414 }
414 415
415 // Fails flakily (once per 10-20 runs) on Win Aura only. http://crbug.com/177482 416 // Fails flakily (once per 10-20 runs) on Win Aura only. http://crbug.com/177482
416 // Also fails on CrOS. 417 // Also fails on CrOS.
417 #if defined(OS_WIN) || defined(OS_CHROMEOS) 418 #if defined(OS_WIN) || defined(OS_CHROMEOS)
418 #define MAYBE_EscapeCloseConstrainedWindow DISABLED_EscapeCloseConstrainedWindow 419 #define MAYBE_EscapeCloseConstrainedWindow DISABLED_EscapeCloseConstrainedWindow
419 #else 420 #else
420 #define MAYBE_EscapeCloseConstrainedWindow EscapeCloseConstrainedWindow 421 #define MAYBE_EscapeCloseConstrainedWindow EscapeCloseConstrainedWindow
421 #endif 422 #endif
422 423
(...skipping 23 matching lines...) Expand all
446 // Escape is not processed as accelerator before it's sent to web contents. 447 // Escape is not processed as accelerator before it's sent to web contents.
447 EXPECT_FALSE(observer.widget_closed()); 448 EXPECT_FALSE(observer.widget_closed());
448 449
449 content::RunAllPendingInMessageLoop(); 450 content::RunAllPendingInMessageLoop();
450 451
451 // Escape is processed as accelerator after it's sent to web contents. 452 // Escape is processed as accelerator after it's sent to web contents.
452 EXPECT_TRUE(observer.widget_closed()); 453 EXPECT_TRUE(observer.widget_closed());
453 } 454 }
454 455
455 #endif // defined(OS_WIN) || (defined(USE_AURA) && defined(USE_X11)) 456 #endif // defined(OS_WIN) || (defined(USE_AURA) && defined(USE_X11))
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_navigator_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698