| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h" |
| 11 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 11 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
| 12 #include "chrome/test/base/testing_profile.h" | 12 #include "chrome/test/base/testing_profile.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #import "testing/gtest_mac.h" | 14 #import "testing/gtest_mac.h" |
| 15 #include "testing/platform_test.h" | 15 #include "testing/platform_test.h" |
| 16 | 16 |
| 17 using base::ASCIIToUTF16; |
| 18 |
| 17 class BookmarkNameFolderControllerTest : public CocoaProfileTest { | 19 class BookmarkNameFolderControllerTest : public CocoaProfileTest { |
| 18 }; | 20 }; |
| 19 | 21 |
| 20 | 22 |
| 21 // Simple add of a node (at the end). | 23 // Simple add of a node (at the end). |
| 22 TEST_F(BookmarkNameFolderControllerTest, AddNew) { | 24 TEST_F(BookmarkNameFolderControllerTest, AddNew) { |
| 23 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile()); | 25 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile()); |
| 24 const BookmarkNode* parent = model->bookmark_bar_node(); | 26 const BookmarkNode* parent = model->bookmark_bar_node(); |
| 25 EXPECT_EQ(0, parent->child_count()); | 27 EXPECT_EQ(0, parent->child_count()); |
| 26 | 28 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 158 |
| 157 [controller setFolderName:@"Bozo"]; | 159 [controller setFolderName:@"Bozo"]; |
| 158 EXPECT_TRUE([[controller okButton] isEnabled]); | 160 EXPECT_TRUE([[controller okButton] isEnabled]); |
| 159 [controller setFolderName:@" "]; | 161 [controller setFolderName:@" "]; |
| 160 EXPECT_TRUE([[controller okButton] isEnabled]); | 162 EXPECT_TRUE([[controller okButton] isEnabled]); |
| 161 | 163 |
| 162 [controller setFolderName:@""]; | 164 [controller setFolderName:@""]; |
| 163 EXPECT_TRUE([[controller okButton] isEnabled]); | 165 EXPECT_TRUE([[controller okButton] isEnabled]); |
| 164 } | 166 } |
| 165 | 167 |
| OLD | NEW |