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

Side by Side Diff: chrome/browser/apps/guest_view/web_view_browsertest.cc

Issue 2958223002: Use ContainsValue() instead of std::find() in chrome/browser and chrome/common (Closed)
Patch Set: Rebase patch. Created 3 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/content_settings/tab_specific_content_settings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <queue> 5 #include <queue>
6 #include <set> 6 #include <set>
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
11 #include "base/files/scoped_temp_dir.h" 11 #include "base/files/scoped_temp_dir.h"
12 #include "base/guid.h" 12 #include "base/guid.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/path_service.h" 15 #include "base/path_service.h"
16 #include "base/process/process.h" 16 #include "base/process/process.h"
17 #include "base/run_loop.h" 17 #include "base/run_loop.h"
18 #include "base/single_thread_task_runner.h" 18 #include "base/single_thread_task_runner.h"
19 #include "base/stl_util.h"
19 #include "base/strings/string_number_conversions.h" 20 #include "base/strings/string_number_conversions.h"
20 #include "base/strings/stringprintf.h" 21 #include "base/strings/stringprintf.h"
21 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
22 #include "base/test/scoped_feature_list.h" 23 #include "base/test/scoped_feature_list.h"
23 #include "base/threading/thread_restrictions.h" 24 #include "base/threading/thread_restrictions.h"
24 #include "base/threading/thread_task_runner_handle.h" 25 #include "base/threading/thread_task_runner_handle.h"
25 #include "build/build_config.h" 26 #include "build/build_config.h"
26 #include "chrome/app/chrome_command_ids.h" 27 #include "chrome/app/chrome_command_ids.h"
27 #include "chrome/browser/apps/app_browsertest_util.h" 28 #include "chrome/browser/apps/app_browsertest_util.h"
28 #include "chrome/browser/chrome_content_browser_client.h" 29 #include "chrome/browser/chrome_content_browser_client.h"
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1723 InterstitialTestHelper(); 1724 InterstitialTestHelper();
1724 1725
1725 content::WebContents* outer_web_contents = GetFirstAppWindowWebContents(); 1726 content::WebContents* outer_web_contents = GetFirstAppWindowWebContents();
1726 content::WebContents* guest_web_contents = 1727 content::WebContents* guest_web_contents =
1727 GetGuestViewManager()->WaitForSingleGuestCreated(); 1728 GetGuestViewManager()->WaitForSingleGuestCreated();
1728 content::InterstitialPage* interstitial_page = 1729 content::InterstitialPage* interstitial_page =
1729 guest_web_contents->GetInterstitialPage(); 1730 guest_web_contents->GetInterstitialPage();
1730 1731
1731 std::vector<content::RenderWidgetHostView*> hosts = 1732 std::vector<content::RenderWidgetHostView*> hosts =
1732 content::GetInputEventRouterRenderWidgetHostViews(outer_web_contents); 1733 content::GetInputEventRouterRenderWidgetHostViews(outer_web_contents);
1733 EXPECT_TRUE(std::find(hosts.begin(), hosts.end(), 1734 EXPECT_TRUE(
1734 interstitial_page->GetMainFrame()->GetView()) != 1735 base::ContainsValue(hosts, interstitial_page->GetMainFrame()->GetView()));
1735 hosts.end());
1736 } 1736 }
1737 1737
1738 // Test makes sure that interstitial pages will receive input events and can be 1738 // Test makes sure that interstitial pages will receive input events and can be
1739 // focused. 1739 // focused.
1740 IN_PROC_BROWSER_TEST_P(WebViewTest, InterstitialPageFocusedWidget) { 1740 IN_PROC_BROWSER_TEST_P(WebViewTest, InterstitialPageFocusedWidget) {
1741 // This test tests that a inner WebContents' InterstitialPage is properly 1741 // This test tests that a inner WebContents' InterstitialPage is properly
1742 // connected to an outer WebContents through a CrossProcessFrameConnector, it 1742 // connected to an outer WebContents through a CrossProcessFrameConnector, it
1743 // doesn't make sense for BrowserPlugin based guests. 1743 // doesn't make sense for BrowserPlugin based guests.
1744 if (!base::FeatureList::IsEnabled(::features::kGuestViewCrossProcessFrames)) 1744 if (!base::FeatureList::IsEnabled(::features::kGuestViewCrossProcessFrames))
1745 return; 1745 return;
(...skipping 2440 matching lines...) Expand 10 before | Expand all | Expand 10 after
4186 ClosingChromeSignInShouldNotCrash) { 4186 ClosingChromeSignInShouldNotCrash) {
4187 GURL signin_url{"chrome://chrome-signin"}; 4187 GURL signin_url{"chrome://chrome-signin"};
4188 4188
4189 AddTabAtIndex(0, signin_url, ui::PAGE_TRANSITION_TYPED); 4189 AddTabAtIndex(0, signin_url, ui::PAGE_TRANSITION_TYPED);
4190 AddTabAtIndex(1, signin_url, ui::PAGE_TRANSITION_TYPED); 4190 AddTabAtIndex(1, signin_url, ui::PAGE_TRANSITION_TYPED);
4191 WaitForWebViewInDom(); 4191 WaitForWebViewInDom();
4192 4192
4193 chrome::CloseTab(browser()); 4193 chrome::CloseTab(browser());
4194 } 4194 }
4195 #endif 4195 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/content_settings/tab_specific_content_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698