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

Side by Side Diff: chrome/browser/extensions/api/content_settings/content_settings_apitest.cc

Issue 2825963003: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/extensions (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
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 <memory> 5 #include <memory>
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // sure it's not the last one, so the message loop doesn't quit 48 // sure it's not the last one, so the message loop doesn't quit
49 // unexpectedly. 49 // unexpectedly.
50 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::BROWSER, 50 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::BROWSER,
51 KeepAliveRestartOption::DISABLED)); 51 KeepAliveRestartOption::DISABLED));
52 } 52 }
53 53
54 void TearDownOnMainThread() override { 54 void TearDownOnMainThread() override {
55 // BrowserProcess::Shutdown() needs to be called in a message loop, so we 55 // BrowserProcess::Shutdown() needs to be called in a message loop, so we
56 // post a task to release the keep alive, then run the message loop. 56 // post a task to release the keep alive, then run the message loop.
57 base::ThreadTaskRunnerHandle::Get()->PostTask( 57 base::ThreadTaskRunnerHandle::Get()->PostTask(
58 FROM_HERE, base::Bind(&std::unique_ptr<ScopedKeepAlive>::reset, 58 FROM_HERE, base::BindOnce(&std::unique_ptr<ScopedKeepAlive>::reset,
59 base::Unretained(&keep_alive_), nullptr)); 59 base::Unretained(&keep_alive_), nullptr));
60 content::RunAllPendingInMessageLoop(); 60 content::RunAllPendingInMessageLoop();
61 61
62 ExtensionApiTest::TearDownOnMainThread(); 62 ExtensionApiTest::TearDownOnMainThread();
63 } 63 }
64 64
65 protected: 65 protected:
66 void CheckContentSettingsSet() { 66 void CheckContentSettingsSet() {
67 HostContentSettingsMap* map = 67 HostContentSettingsMap* map =
68 HostContentSettingsMapFactory::GetForProfile(profile_); 68 HostContentSettingsMapFactory::GetForProfile(profile_);
69 content_settings::CookieSettings* cookie_settings = 69 content_settings::CookieSettings* cookie_settings =
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 << message_; 279 << message_;
280 } 280 }
281 281
282 IN_PROC_BROWSER_TEST_F(ExtensionContentSettingsApiTest, 282 IN_PROC_BROWSER_TEST_F(ExtensionContentSettingsApiTest,
283 UnsupportedDefaultSettings) { 283 UnsupportedDefaultSettings) {
284 const char kExtensionPath[] = "content_settings/unsupporteddefaultsettings"; 284 const char kExtensionPath[] = "content_settings/unsupporteddefaultsettings";
285 EXPECT_TRUE(RunExtensionSubtest(kExtensionPath, "test.html")) << message_; 285 EXPECT_TRUE(RunExtensionSubtest(kExtensionPath, "test.html")) << message_;
286 } 286 }
287 287
288 } // namespace extensions 288 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698