| Index: chrome/browser/ui/cocoa/location_bar/search_token_decoration_unittest.mm
 | 
| diff --git a/chrome/browser/ui/cocoa/location_bar/search_token_decoration_unittest.mm b/chrome/browser/ui/cocoa/location_bar/search_token_decoration_unittest.mm
 | 
| new file mode 100644
 | 
| index 0000000000000000000000000000000000000000..bed2efa7cf932658627cae94c634b3479a694d47
 | 
| --- /dev/null
 | 
| +++ b/chrome/browser/ui/cocoa/location_bar/search_token_decoration_unittest.mm
 | 
| @@ -0,0 +1,38 @@
 | 
| +// Copyright (c) 2013 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 "chrome/browser/ui/cocoa/location_bar/search_token_decoration.h"
 | 
| +
 | 
| +#include "base/utf_string_conversions.h"
 | 
| +#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
 | 
| +#include "testing/gtest/include/gtest/gtest.h"
 | 
| +
 | 
| +typedef CocoaTest SearchTokenDecorationTest;
 | 
| +
 | 
| +TEST_F(SearchTokenDecorationTest, GetWidthForSpace) {
 | 
| +  SearchTokenDecoration decoration;
 | 
| +
 | 
| +  decoration.set_search_provider_name(ASCIIToUTF16("short"));
 | 
| +  CGFloat short_width = decoration.GetWidthForSpace(1000);
 | 
| +  EXPECT_LT(0, short_width);
 | 
| +
 | 
| +  decoration.set_search_provider_name(ASCIIToUTF16("longer name"));
 | 
| +  CGFloat long_width = decoration.GetWidthForSpace(1000);
 | 
| +  EXPECT_LT(short_width, long_width);
 | 
| +
 | 
| +  CGFloat omit_width = decoration.GetWidthForSpace(1);
 | 
| +  EXPECT_EQ(omit_width, LocationBarDecoration::kOmittedWidth);
 | 
| +}
 | 
| +
 | 
| +TEST_F(SearchTokenDecorationTest, DrawInFrame) {
 | 
| +  NSRect frame = NSMakeRect(0, 0, 100, 100);
 | 
| +  scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:frame]);
 | 
| +  [[test_window() contentView] addSubview:view];
 | 
| +
 | 
| +  [view lockFocus];
 | 
| +  SearchTokenDecoration decoration;
 | 
| +  decoration.set_search_provider_name(ASCIIToUTF16("short"));
 | 
| +  decoration.DrawInFrame(frame, view);
 | 
| +  [view unlockFocus];
 | 
| +}
 | 
| 
 |