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

Side by Side Diff: chrome/browser/ui/browser_focus_uitest.cc

Issue 627043002: replace OVERRIDE and FINAL with override and final in chrome/browser/ui/[a-s]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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/bind.h" 5 #include "base/bind.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // action we take. 58 // action we take.
59 const int kActionDelayMs = 500; 59 const int kActionDelayMs = 500;
60 60
61 const char kSimplePage[] = "/focus/page_with_focus.html"; 61 const char kSimplePage[] = "/focus/page_with_focus.html";
62 const char kStealFocusPage[] = "/focus/page_steals_focus.html"; 62 const char kStealFocusPage[] = "/focus/page_steals_focus.html";
63 const char kTypicalPage[] = "/focus/typical_page.html"; 63 const char kTypicalPage[] = "/focus/typical_page.html";
64 64
65 class BrowserFocusTest : public InProcessBrowserTest { 65 class BrowserFocusTest : public InProcessBrowserTest {
66 public: 66 public:
67 // InProcessBrowserTest overrides: 67 // InProcessBrowserTest overrides:
68 virtual void SetUpOnMainThread() OVERRIDE { 68 virtual void SetUpOnMainThread() override {
69 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 69 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
70 } 70 }
71 71
72 bool IsViewFocused(ViewID vid) { 72 bool IsViewFocused(ViewID vid) {
73 return ui_test_utils::IsViewFocused(browser(), vid); 73 return ui_test_utils::IsViewFocused(browser(), vid);
74 } 74 }
75 75
76 void ClickOnView(ViewID vid) { 76 void ClickOnView(ViewID vid) {
77 ui_test_utils::ClickOnView(browser(), vid); 77 ui_test_utils::ClickOnView(browser(), vid);
78 } 78 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 // A helper class that waits for an interstitial page to attach. 139 // A helper class that waits for an interstitial page to attach.
140 class WaitForInterstitial : public content::WebContentsObserver { 140 class WaitForInterstitial : public content::WebContentsObserver {
141 public: 141 public:
142 explicit WaitForInterstitial(content::WebContents* tab) 142 explicit WaitForInterstitial(content::WebContents* tab)
143 : WebContentsObserver(tab), 143 : WebContentsObserver(tab),
144 runner_(new content::MessageLoopRunner) { 144 runner_(new content::MessageLoopRunner) {
145 runner_->Run(); 145 runner_->Run();
146 } 146 }
147 147
148 virtual void DidAttachInterstitialPage() OVERRIDE { runner_->Quit(); } 148 virtual void DidAttachInterstitialPage() override { runner_->Quit(); }
149 virtual void DidDetachInterstitialPage() OVERRIDE { NOTREACHED(); } 149 virtual void DidDetachInterstitialPage() override { NOTREACHED(); }
150 150
151 private: 151 private:
152 scoped_refptr<content::MessageLoopRunner> runner_; 152 scoped_refptr<content::MessageLoopRunner> runner_;
153 DISALLOW_COPY_AND_ASSIGN(WaitForInterstitial); 153 DISALLOW_COPY_AND_ASSIGN(WaitForInterstitial);
154 }; 154 };
155 155
156 // A test interstitial page with typical HTML contents. 156 // A test interstitial page with typical HTML contents.
157 class TestInterstitialPage : public content::InterstitialPageDelegate { 157 class TestInterstitialPage : public content::InterstitialPageDelegate {
158 public: 158 public:
159 explicit TestInterstitialPage(WebContents* tab) { 159 explicit TestInterstitialPage(WebContents* tab) {
160 base::FilePath file_path; 160 base::FilePath file_path;
161 bool success = PathService::Get(chrome::DIR_TEST_DATA, &file_path); 161 bool success = PathService::Get(chrome::DIR_TEST_DATA, &file_path);
162 EXPECT_TRUE(success); 162 EXPECT_TRUE(success);
163 file_path = file_path.AppendASCII("focus/typical_page.html"); 163 file_path = file_path.AppendASCII("focus/typical_page.html");
164 success = base::ReadFileToString(file_path, &html_contents_); 164 success = base::ReadFileToString(file_path, &html_contents_);
165 EXPECT_TRUE(success); 165 EXPECT_TRUE(success);
166 interstitial_page_ = content::InterstitialPage::Create( 166 interstitial_page_ = content::InterstitialPage::Create(
167 tab, true, GURL("http://interstitial.com"), this); 167 tab, true, GURL("http://interstitial.com"), this);
168 168
169 // Show the interstitial and delay return until it has attached. 169 // Show the interstitial and delay return until it has attached.
170 interstitial_page_->Show(); 170 interstitial_page_->Show();
171 WaitForInterstitial wait(tab); 171 WaitForInterstitial wait(tab);
172 EXPECT_TRUE(tab->ShowingInterstitialPage()); 172 EXPECT_TRUE(tab->ShowingInterstitialPage());
173 } 173 }
174 174
175 virtual std::string GetHTMLContents() OVERRIDE { return html_contents_; } 175 virtual std::string GetHTMLContents() override { return html_contents_; }
176 176
177 RenderViewHost* render_view_host() { 177 RenderViewHost* render_view_host() {
178 return interstitial_page_->GetRenderViewHostForTesting(); 178 return interstitial_page_->GetRenderViewHostForTesting();
179 } 179 }
180 180
181 void DontProceed() { interstitial_page_->DontProceed(); } 181 void DontProceed() { interstitial_page_->DontProceed(); }
182 182
183 bool HasFocus() { return render_view_host()->GetView()->HasFocus(); } 183 bool HasFocus() { return render_view_host()->GetView()->HasFocus(); }
184 184
185 private: 185 private:
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 content::NOTIFICATION_NAV_ENTRY_COMMITTED, 695 content::NOTIFICATION_NAV_ENTRY_COMMITTED,
696 content::NotificationService::AllSources()); 696 content::NotificationService::AllSources());
697 chrome::GoForward(browser(), CURRENT_TAB); 697 chrome::GoForward(browser(), CURRENT_TAB);
698 forward_nav_observer.Wait(); 698 forward_nav_observer.Wait();
699 } 699 }
700 700
701 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); 701 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX));
702 } 702 }
703 703
704 } // namespace 704 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_content_translate_driver_observer.h ('k') | chrome/browser/ui/browser_instant_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698