diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-21 16:59:19 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-21 16:59:19 +0000 |
commit | 6f2c41a3bc45fc8ad62720ab45b9ea085eea74f4 (patch) | |
tree | aef3350de06e1daa2ef4a6271d0fbc29f2d8a23f /chrome/browser/cocoa/content_blocked_bubble_controller_unittest.mm | |
parent | 024afb4486f3d91faa87443eaad3ebde584e9613 (diff) | |
download | chromium_src-6f2c41a3bc45fc8ad62720ab45b9ea085eea74f4.zip chromium_src-6f2c41a3bc45fc8ad62720ab45b9ea085eea74f4.tar.gz chromium_src-6f2c41a3bc45fc8ad62720ab45b9ea085eea74f4.tar.bz2 |
Mac: Show content blocked bubbles.
Two screenshots at http://imgur.com/5NDoC&pJJwP .
xib changes: All 5 xibs contain a window of type InfoBubbleWindow with a custom InfoBubbleView. The view is connected to the controller's |bubble_| outlet. The controller is the window's |delegate|, and the window is the controller's |window|. The window is not visible at launch. It autorecalculates its key view loop. For the non-cookie xibs, the two buttons at the bottom are in GTMWidthBasedTweakers.
Issues:
* Clicking "blocked" icon with open bubble doesn't close the bubble
BUG=35594,34894
TEST=Go to popuptest.com, start test. Click "Popups blocked" icon in omnibox. Bubble should appear. It should look sane in multiple locales (I tried English and German). The left button and the radio buttons are disabled at the moment, but the close button and the popup links should be functional.
Review URL: http://codereview.chromium.org/650073
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/content_blocked_bubble_controller_unittest.mm')
-rw-r--r-- | chrome/browser/cocoa/content_blocked_bubble_controller_unittest.mm | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/content_blocked_bubble_controller_unittest.mm b/chrome/browser/cocoa/content_blocked_bubble_controller_unittest.mm new file mode 100644 index 0000000..e78508a5 --- /dev/null +++ b/chrome/browser/cocoa/content_blocked_bubble_controller_unittest.mm @@ -0,0 +1,49 @@ +// Copyright (c) 2010 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. + +#import <Cocoa/Cocoa.h> + +#include "base/scoped_nsobject.h" +#import "chrome/browser/cocoa/cocoa_test_helper.h" +#import "chrome/browser/cocoa/content_blocked_bubble_controller.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace { + +class ContentBlockedBubbleControllerTest : public CocoaTest { +}; + +// Check that the bubble doesn't crash or leak for any settings type +TEST_F(ContentBlockedBubbleControllerTest, Init) { + for (int i = 0; i < CONTENT_SETTINGS_NUM_TYPES; ++i) { + ContentSettingsType settingsType = static_cast<ContentSettingsType>(i); + + scoped_nsobject<NSWindow> parent([[NSWindow alloc] + initWithContentRect:NSMakeRect(0, 0, 800, 600) + styleMask:NSBorderlessWindowMask + backing:NSBackingStoreBuffered + defer:NO]); + [parent setReleasedWhenClosed:NO]; + if (DebugUtil::BeingDebugged()) + [parent.get() orderFront:nil]; + else + [parent.get() orderBack:nil]; + + ContentBlockedBubbleController* controller = + [ContentBlockedBubbleController showForType:settingsType + parentWindow:parent + anchoredAt:NSMakePoint(50, 20) + host:"http://te.net" + displayHost:@"te.net" + tabContents:NULL + profile:NULL]; + EXPECT_TRUE(controller != nil); + [controller showWindow:nil]; + [parent.get() close]; + } +} + +} // namespace + + |