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

Unified Diff: chrome/browser/cocoa/extensions/extension_popup_controller_unittest.mm

Issue 402077: Adds popups to browser actions, completing the feature.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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/cocoa/extensions/extension_popup_controller_unittest.mm
===================================================================
--- chrome/browser/cocoa/extensions/extension_popup_controller_unittest.mm (revision 0)
+++ chrome/browser/cocoa/extensions/extension_popup_controller_unittest.mm (revision 0)
@@ -0,0 +1,90 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/scoped_nsobject.h"
+#include "chrome/browser/cocoa/browser_test_helper.h"
+#include "chrome/browser/cocoa/cocoa_test_helper.h"
+#include "chrome/browser/cocoa/extensions/extension_popup_controller.h"
+#include "chrome/browser/extensions/extension_process_manager.h"
+#include "chrome/browser/extensions/extensions_service.h"
+#include "chrome/test/testing_profile.h"
+
+namespace {
+
+class ExtensionTestingProfile : public TestingProfile {
+ public:
+ ExtensionTestingProfile() {}
+
+ FilePath GetExtensionsInstallDir() {
+ return GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName);
+ }
+
+ void InitExtensionProfile() {
+ DCHECK(!GetExtensionProcessManager());
+ DCHECK(!GetExtensionsService());
+
+ manager_.reset(new ExtensionProcessManager(this));
+ service_ = new ExtensionsService(this,
+ CommandLine::ForCurrentProcess(),
+ GetPrefs(),
+ GetExtensionsInstallDir(),
+ false);
+ service_->set_extensions_enabled(true);
+ service_->set_show_extensions_prompts(false);
+ service_->ClearProvidersForTesting();
+ service_->Init();
+ }
+
+ void ShutdownExtensionProfile() {
+ manager_.reset();
+ service_ = NULL;
+ }
+
+ virtual ExtensionProcessManager* GetExtensionProcessManager() {
+ return manager_.get();
+ }
+
+ virtual ExtensionsService* GetExtensionsService() {
+ return service_.get();
+ }
+
+ private:
+ scoped_ptr<ExtensionProcessManager> manager_;
+ scoped_refptr<ExtensionsService> service_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionTestingProfile);
+};
+
+class ExtensionPopupControllerTest : public CocoaTest {
+ public:
+ virtual void SetUp() {
+ CocoaTest::SetUp();
+ profile_.reset(new ExtensionTestingProfile());
+ profile_->InitExtensionProfile();
+ browser_.reset(new Browser(Browser::TYPE_NORMAL, profile_.get()));
+ popup_controller_.reset(
+ [ExtensionPopupController showURL:GURL("http://google.com")
+ inBrowser:browser_.get()
+ anchoredAt:NSZeroPoint
+ arrowLocation:kTopRight]);
+ }
+ virtual void TearDown() {
+ profile_->ShutdownExtensionProfile();
+ CocoaTest::TearDown();
+ }
+
+ protected:
+ scoped_nsobject<ExtensionPopupController> popup_controller_;
+ scoped_ptr<Browser> browser_;
+ scoped_ptr<ExtensionTestingProfile> profile_;
+};
+
+TEST_F(ExtensionPopupControllerTest, DISABLED_Basics) {
+ // TODO(andybons): Better mechanisms for mocking out the extensions service
+ // and extensions for easy testing need to be implemented.
+ // http://crbug.com/28316
+ EXPECT_TRUE(popup_controller_.get());
+}
+
+} // namespace
Property changes on: chrome/browser/cocoa/extensions/extension_popup_controller_unittest.mm
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/cocoa/extensions/extension_popup_controller.mm ('k') | chrome/browser/cocoa/info_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698