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

Side by Side Diff: chrome/browser/extensions/extension_reenabler_unittest.cc

Issue 1534123002: [Extensions] Migrate ExtensionInstallPrompt::Delegate to be a callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/macros.h" 5 #include "base/macros.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "chrome/browser/extensions/extension_install_prompt.h" 7 #include "chrome/browser/extensions/extension_install_prompt.h"
8 #include "chrome/browser/extensions/extension_reenabler.h" 8 #include "chrome/browser/extensions/extension_reenabler.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_service_test_base.h" 10 #include "chrome/browser/extensions/extension_service_test_base.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 private: 75 private:
76 // The callback to run once the reenable process finishes. 76 // The callback to run once the reenable process finishes.
77 void OnComplete(ExtensionReenabler::ReenableResult result) { 77 void OnComplete(ExtensionReenabler::ReenableResult result) {
78 result_.reset(new ExtensionReenabler::ReenableResult(result)); 78 result_.reset(new ExtensionReenabler::ReenableResult(result));
79 } 79 }
80 80
81 // The callback to run when a test ExtensionInstallPrompt is ready to show. 81 // The callback to run when a test ExtensionInstallPrompt is ready to show.
82 void OnShow(ExtensionInstallPromptShowParams* show_params, 82 void OnShow(ExtensionInstallPromptShowParams* show_params,
83 ExtensionInstallPrompt::Delegate* delegate, 83 const ExtensionInstallPrompt::DoneCallback& done_callback,
84 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt) { 84 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt) {
85 DCHECK(!quit_closure_.is_null()); 85 DCHECK(!quit_closure_.is_null());
86 quit_closure_.Run(); 86 quit_closure_.Run();
87 quit_closure_ = base::Closure(); 87 quit_closure_ = base::Closure();
88 } 88 }
89 89
90 // The closure to quit the currently-running loop; used with test 90 // The closure to quit the currently-running loop; used with test
91 // ExtensionInstallPrompts. 91 // ExtensionInstallPrompts.
92 base::Closure quit_closure_; 92 base::Closure quit_closure_;
93 93
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 EXPECT_FALSE(callback_helper.has_result()); 261 EXPECT_FALSE(callback_helper.has_result());
262 // Destroy the reenabler to simulate the owning context being shut down 262 // Destroy the reenabler to simulate the owning context being shut down
263 // (e.g., the tab closing). 263 // (e.g., the tab closing).
264 extension_reenabler.reset(); 264 extension_reenabler.reset();
265 EXPECT_TRUE( 265 EXPECT_TRUE(
266 callback_helper.result_matches(ExtensionReenabler::ABORTED)); 266 callback_helper.result_matches(ExtensionReenabler::ABORTED));
267 } 267 }
268 } 268 }
269 269
270 } // namespace extensions 270 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_reenabler.cc ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698