diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 16:40:39 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 16:40:39 +0000 |
commit | 7a3bdc0069b8ae1ed6eb115999878cee5cfa9360 (patch) | |
tree | 75bb0ee47dcfade7689c00a843e8f516a1d78cb1 /chrome/browser/cocoa/background_tile_view_unittest.mm | |
parent | 7911717865f60ebb922f07d1cf45249b9717cb00 (diff) | |
download | chromium_src-7a3bdc0069b8ae1ed6eb115999878cee5cfa9360.zip chromium_src-7a3bdc0069b8ae1ed6eb115999878cee5cfa9360.tar.gz chromium_src-7a3bdc0069b8ae1ed6eb115999878cee5cfa9360.tar.bz2 |
Add background_tile_view for tiling an image as UI background (about box needed it)
Added restart_browser as a helper like Views helper for putting up a request for the user to restart.
Added a new string needed for Mac style alerts to go with the existing restart string.
Make Mac Chromium use a custom about box.
Give Chromium and Google Chrome an about box that matches the one on other platforms
Use all the existing UI strings for the about box so we get credits, copy rights, etc.
TEST=New aboutbox for Chromium and Google Chrome. About box should be fully l10n and size as needed. Chrome update messaging should more match windows and be localized.
BUG=13219,19020
Review URL: http://codereview.chromium.org/173606
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24737 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/background_tile_view_unittest.mm')
-rw-r--r-- | chrome/browser/cocoa/background_tile_view_unittest.mm | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/background_tile_view_unittest.mm b/chrome/browser/cocoa/background_tile_view_unittest.mm new file mode 100644 index 0000000..d225fca --- /dev/null +++ b/chrome/browser/cocoa/background_tile_view_unittest.mm @@ -0,0 +1,44 @@ +// 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. + +#import <Cocoa/Cocoa.h> + +#include "base/scoped_nsobject.h" +#import "chrome/browser/cocoa/background_tile_view.h" +#import "chrome/browser/cocoa/cocoa_test_helper.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace { + +class BackgroundTileViewTest : public testing::Test { + public: + BackgroundTileViewTest() { + NSRect frame = NSMakeRect(0, 0, 100, 30); + view_.reset([[BackgroundTileView alloc] initWithFrame:frame]); + [cocoa_helper_.contentView() addSubview:view_.get()]; + } + + CocoaTestHelper cocoa_helper_; // Inits Cocoa, creates window, etc... + scoped_nsobject<BackgroundTileView> view_; +}; + +// Test adding/removing from the view hierarchy, mostly to ensure nothing +// leaks or crashes. +TEST_F(BackgroundTileViewTest, AddRemove) { + EXPECT_EQ(cocoa_helper_.contentView(), [view_ superview]); + [view_.get() removeFromSuperview]; + EXPECT_FALSE([view_ superview]); +} + +// Test drawing, mostly to ensure nothing leaks or crashes. +TEST_F(BackgroundTileViewTest, Display) { + // Without image set. + [view_ display]; + // And now with an image. + NSImage* image = [NSImage imageNamed:@"NSApplicationIcon"]; + [view_ setTileImage:image]; + [view_ display]; +} + +} // namespace |