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

Side by Side Diff: chrome/browser/plugins/chrome_plugin_service_filter_unittest.cc

Issue 2828663002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/{i,l,m,n,p,r}* (Closed)
Patch Set: Created 3 years, 8 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 | « chrome/browser/platform_util.cc ('k') | chrome/browser/plugins/plugin_info_message_filter.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/plugins/chrome_plugin_service_filter.h" 5 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const url::Origin& main_frame_origin, 58 const url::Origin& main_frame_origin,
59 const void* resource_context, 59 const void* resource_context,
60 const content::WebPluginInfo& plugin_info) { 60 const content::WebPluginInfo& plugin_info) {
61 bool is_available = false; 61 bool is_available = false;
62 62
63 // ChromePluginServiceFilter::IsPluginAvailable always runs on the IO 63 // ChromePluginServiceFilter::IsPluginAvailable always runs on the IO
64 // thread. Use a RunLoop to ensure this method blocks until it posts back. 64 // thread. Use a RunLoop to ensure this method blocks until it posts back.
65 base::RunLoop run_loop; 65 base::RunLoop run_loop;
66 content::BrowserThread::PostTaskAndReply( 66 content::BrowserThread::PostTaskAndReply(
67 content::BrowserThread::IO, FROM_HERE, 67 content::BrowserThread::IO, FROM_HERE,
68 base::Bind(&ChromePluginServiceFilterTest::IsPluginAvailableOnIOThread, 68 base::BindOnce(
69 base::Unretained(this), plugin_content_url, 69 &ChromePluginServiceFilterTest::IsPluginAvailableOnIOThread,
70 main_frame_origin, resource_context, plugin_info, 70 base::Unretained(this), plugin_content_url, main_frame_origin,
71 &is_available), 71 resource_context, plugin_info, &is_available),
72 run_loop.QuitClosure()); 72 run_loop.QuitClosure());
73 run_loop.Run(); 73 run_loop.Run();
74 74
75 return is_available; 75 return is_available;
76 } 76 }
77 77
78 protected: 78 protected:
79 void SetUp() override { 79 void SetUp() override {
80 ChromeRenderViewHostTestHarness::SetUp(); 80 ChromeRenderViewHostTestHarness::SetUp();
81 SiteEngagementScore::SetParamValuesForTesting(); 81 SiteEngagementScore::SetParamValuesForTesting();
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 service->ResetBaseScoreForURL(url, 0); 433 service->ResetBaseScoreForURL(url, 0);
434 EXPECT_FALSE(IsPluginAvailable( 434 EXPECT_FALSE(IsPluginAvailable(
435 url, main_frame_origin, profile()->GetResourceContext(), flash_plugin)); 435 url, main_frame_origin, profile()->GetResourceContext(), flash_plugin));
436 436
437 // Allow flash temporarily. 437 // Allow flash temporarily.
438 FlashTemporaryPermissionTracker::Get(profile())->FlashEnabledForWebContents( 438 FlashTemporaryPermissionTracker::Get(profile())->FlashEnabledForWebContents(
439 web_contents()); 439 web_contents());
440 EXPECT_TRUE(IsPluginAvailable(url, main_frame_origin, 440 EXPECT_TRUE(IsPluginAvailable(url, main_frame_origin,
441 profile()->GetResourceContext(), flash_plugin)); 441 profile()->GetResourceContext(), flash_plugin));
442 } 442 }
OLDNEW
« no previous file with comments | « chrome/browser/platform_util.cc ('k') | chrome/browser/plugins/plugin_info_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698