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

Unified Diff: chrome/browser/extensions/extension_function_test_utils.cc

Issue 8520035: Revert 110264 - Fix for management API related to escalated permissions disabled extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_function_test_utils.cc
===================================================================
--- chrome/browser/extensions/extension_function_test_utils.cc (revision 110267)
+++ chrome/browser/extensions/extension_function_test_utils.cc (working copy)
@@ -13,7 +13,6 @@
#include "chrome/browser/extensions/extension_function_dispatcher.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/test/base/ui_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -161,58 +160,4 @@
function->Run();
}
-// This helps us be able to wait until an AsyncExtensionFunction calls
-// SendResponse.
-class SendResponseDelegate : public AsyncExtensionFunction::DelegateForTests {
- public:
- SendResponseDelegate() : should_post_quit_(false) {}
-
- virtual ~SendResponseDelegate() {}
-
- void set_should_post_quit(bool should_quit) {
- should_post_quit_ = should_quit;
- }
-
- bool HasResponse() {
- return response_.get() != NULL;
- }
-
- bool GetResponse() {
- EXPECT_TRUE(HasResponse());
- return *response_.get();
- }
-
- virtual void OnSendResponse(AsyncExtensionFunction* function, bool success) {
- ASSERT_FALSE(HasResponse());
- response_.reset(new bool);
- *response_ = success;
- if (should_post_quit_) {
- MessageLoopForUI::current()->Quit();
- }
- }
-
- private:
- scoped_ptr<bool> response_;
- bool should_post_quit_;
-};
-
-bool RunAsyncFunction(AsyncExtensionFunction* function,
- const std::string& args,
- Browser* browser,
- RunFunctionFlags flags) {
- SendResponseDelegate response_delegate;
- function->set_test_delegate(&response_delegate);
- RunFunction(function, args, browser, flags);
-
- // If the RunImpl of |function| didn't already call SendResponse, run the
- // message loop until they do.
- if (!response_delegate.HasResponse()) {
- response_delegate.set_should_post_quit(true);
- ui_test_utils::RunMessageLoop();
- }
-
- EXPECT_TRUE(response_delegate.HasResponse());
- return response_delegate.GetResponse();
-}
-
} // namespace extension_function_test_utils
« no previous file with comments | « chrome/browser/extensions/extension_function_test_utils.h ('k') | chrome/browser/extensions/extension_install_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698