| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <AppKit/AppKit.h> | 5 #include <AppKit/AppKit.h> |
| 6 | 6 |
| 7 #include "base/memory/scoped_nsobject.h" | 7 #include "base/memory/scoped_nsobject.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #import "chrome/common/attributed_string_coder_mac.h" | 10 #import "chrome/common/mac/attributed_string_coder.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "testing/gtest_mac.h" | 12 #include "testing/gtest_mac.h" |
| 13 | 13 |
| 14 using mac::AttributedStringCoder; | 14 using mac::AttributedStringCoder; |
| 15 | 15 |
| 16 class AttributedStringCoderTest : public testing::Test { | 16 class AttributedStringCoderTest : public testing::Test { |
| 17 public: | 17 public: |
| 18 NSMutableAttributedString* NewAttrString() { | 18 NSMutableAttributedString* NewAttrString() { |
| 19 NSString* str = @"The quick brown fox jumped over the lazy dog."; | 19 NSString* str = @"The quick brown fox jumped over the lazy dog."; |
| 20 return [[NSMutableAttributedString alloc] initWithString:str]; | 20 return [[NSMutableAttributedString alloc] initWithString:str]; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 NSRange range; | 126 NSRange range; |
| 127 NSDictionary* attrs = [decoded attributesAtIndex:0 effectiveRange:&range]; | 127 NSDictionary* attrs = [decoded attributesAtIndex:0 effectiveRange:&range]; |
| 128 EXPECT_NSEQ([NSFont systemFontOfSize:12], | 128 EXPECT_NSEQ([NSFont systemFontOfSize:12], |
| 129 [attrs objectForKey:NSFontAttributeName]); | 129 [attrs objectForKey:NSFontAttributeName]); |
| 130 EXPECT_TRUE(NSEqualRanges(range, NSMakeRange(0, 5))); | 130 EXPECT_TRUE(NSEqualRanges(range, NSMakeRange(0, 5))); |
| 131 | 131 |
| 132 attrs = [decoded attributesAtIndex:5 effectiveRange:&range]; | 132 attrs = [decoded attributesAtIndex:5 effectiveRange:&range]; |
| 133 EXPECT_FALSE([attrs objectForKey:NSFontAttributeName]); | 133 EXPECT_FALSE([attrs objectForKey:NSFontAttributeName]); |
| 134 EXPECT_EQ(0U, [attrs count]); | 134 EXPECT_EQ(0U, [attrs count]); |
| 135 } | 135 } |
| OLD | NEW |