| OLD | NEW |
| 1 // Copyright (c) 2009-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009-2010 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "app/tree_model.h" | 7 #include "app/tree_model.h" |
| 8 #import "base/scoped_nsobject.h" | 8 #import "base/scoped_nsobject.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/browser/cocoa/browser_test_helper.h" | 10 #include "chrome/browser/cocoa/browser_test_helper.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // window controller. This leads to errors for |-addObject:| messages. Maybe | 47 // window controller. This leads to errors for |-addObject:| messages. Maybe |
| 48 // it's a compiler bug? Or there's something strange happening via swizzling in | 48 // it's a compiler bug? Or there's something strange happening via swizzling in |
| 49 // the test environment? Or did somebody forget to sacrifice a lamb on the new | 49 // the test environment? Or did somebody forget to sacrifice a lamb on the new |
| 50 // moon? After investigating for long time, the easiest/best solution was to | 50 // moon? After investigating for long time, the easiest/best solution was to |
| 51 // create this hacky secondary getter. | 51 // create this hacky secondary getter. |
| 52 @interface CocoaCookieTreeNode (UglyHacks) | 52 @interface CocoaCookieTreeNode (UglyHacks) |
| 53 - (NSMutableArray*)childs; | 53 - (NSMutableArray*)childs; |
| 54 @end | 54 @end |
| 55 @implementation CocoaCookieTreeNode (UglyHacks) | 55 @implementation CocoaCookieTreeNode (UglyHacks) |
| 56 - (NSMutableArray*)childs { | 56 - (NSMutableArray*)childs { |
| 57 return children_.get(); | 57 return (NSMutableArray*)[self children]; |
| 58 } | 58 } |
| 59 @end | 59 @end |
| 60 | 60 |
| 61 namespace { | 61 namespace { |
| 62 | 62 |
| 63 class CookiesWindowControllerTest : public CocoaTest { | 63 class CookiesWindowControllerTest : public CocoaTest { |
| 64 public: | 64 public: |
| 65 virtual void SetUp() { | 65 virtual void SetUp() { |
| 66 CocoaTest::SetUp(); | 66 CocoaTest::SetUp(); |
| 67 TestingProfile* profile = browser_helper_.profile(); | 67 TestingProfile* profile = browser_helper_.profile(); |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 [controller_ updateFilter:field]; | 546 [controller_ updateFilter:field]; |
| 547 EXPECT_EQ(0U, [[[controller_ cocoaTreeModel] childs] count]); | 547 EXPECT_EQ(0U, [[[controller_ cocoaTreeModel] childs] count]); |
| 548 | 548 |
| 549 // Search for "aa". | 549 // Search for "aa". |
| 550 [field setStringValue:@"aa"]; | 550 [field setStringValue:@"aa"]; |
| 551 [controller_ updateFilter:field]; | 551 [controller_ updateFilter:field]; |
| 552 EXPECT_EQ(1U, [[[controller_ cocoaTreeModel] childs] count]); | 552 EXPECT_EQ(1U, [[[controller_ cocoaTreeModel] childs] count]); |
| 553 } | 553 } |
| 554 | 554 |
| 555 } // namespace | 555 } // namespace |
| OLD | NEW |