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

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

Issue 789703004: Reflect the status of a request for accessing a blacklisted url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 12 matching lines...) Expand all
23 #include "chrome/browser/ui/tabs/tab_strip_model.h" 23 #include "chrome/browser/ui/tabs/tab_strip_model.h"
24 #include "chrome/browser/ui/view_ids.h" 24 #include "chrome/browser/ui/view_ids.h"
25 #include "chrome/common/chrome_paths.h" 25 #include "chrome/common/chrome_paths.h"
26 #include "chrome/common/url_constants.h" 26 #include "chrome/common/url_constants.h"
27 #include "chrome/test/base/in_process_browser_test.h" 27 #include "chrome/test/base/in_process_browser_test.h"
28 #include "chrome/test/base/interactive_test_utils.h" 28 #include "chrome/test/base/interactive_test_utils.h"
29 #include "chrome/test/base/ui_test_utils.h" 29 #include "chrome/test/base/ui_test_utils.h"
30 #include "content/public/browser/interstitial_page.h" 30 #include "content/public/browser/interstitial_page.h"
31 #include "content/public/browser/interstitial_page_delegate.h" 31 #include "content/public/browser/interstitial_page_delegate.h"
32 #include "content/public/browser/notification_service.h" 32 #include "content/public/browser/notification_service.h"
33 #include "content/public/browser/render_frame_host.h"
33 #include "content/public/browser/render_view_host.h" 34 #include "content/public/browser/render_view_host.h"
34 #include "content/public/browser/render_widget_host_view.h" 35 #include "content/public/browser/render_widget_host_view.h"
35 #include "content/public/browser/web_contents.h" 36 #include "content/public/browser/web_contents.h"
36 #include "content/public/test/browser_test_utils.h" 37 #include "content/public/test/browser_test_utils.h"
37 #include "net/test/embedded_test_server/embedded_test_server.h" 38 #include "net/test/embedded_test_server/embedded_test_server.h"
38 39
39 #if defined(OS_WIN) 40 #if defined(OS_WIN)
40 #include "base/win/windows_version.h" 41 #include "base/win/windows_version.h"
41 #endif 42 #endif
42 43
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // Show the interstitial and delay return until it has attached. 166 // Show the interstitial and delay return until it has attached.
166 interstitial_page_->Show(); 167 interstitial_page_->Show();
167 content::WaitForInterstitialAttach(tab); 168 content::WaitForInterstitialAttach(tab);
168 169
169 EXPECT_TRUE(tab->ShowingInterstitialPage()); 170 EXPECT_TRUE(tab->ShowingInterstitialPage());
170 } 171 }
171 172
172 std::string GetHTMLContents() override { return html_contents_; } 173 std::string GetHTMLContents() override { return html_contents_; }
173 174
174 RenderViewHost* render_view_host() { 175 RenderViewHost* render_view_host() {
175 return interstitial_page_->GetRenderViewHostForTesting(); 176 return interstitial_page_->GetMainFrame()->GetRenderViewHost();
176 } 177 }
177 178
178 void DontProceed() { interstitial_page_->DontProceed(); } 179 void DontProceed() { interstitial_page_->DontProceed(); }
179 180
180 bool HasFocus() { return render_view_host()->GetView()->HasFocus(); } 181 bool HasFocus() { return render_view_host()->GetView()->HasFocus(); }
181 182
182 private: 183 private:
183 std::string html_contents_; 184 std::string html_contents_;
184 content::InterstitialPage* interstitial_page_; // Owns this. 185 content::InterstitialPage* interstitial_page_; // Owns this.
185 DISALLOW_COPY_AND_ASSIGN(TestInterstitialPage); 186 DISALLOW_COPY_AND_ASSIGN(TestInterstitialPage);
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 content::NOTIFICATION_NAV_ENTRY_COMMITTED, 700 content::NOTIFICATION_NAV_ENTRY_COMMITTED,
700 content::NotificationService::AllSources()); 701 content::NotificationService::AllSources());
701 chrome::GoForward(browser(), CURRENT_TAB); 702 chrome::GoForward(browser(), CURRENT_TAB);
702 forward_nav_observer.Wait(); 703 forward_nav_observer.Wait();
703 } 704 }
704 705
705 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); 706 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX));
706 } 707 }
707 708
708 } // namespace 709 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_interstitial.cc ('k') | content/browser/android/content_view_core_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698