OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/scoped_nsobject.h" | 8 #include "base/scoped_nsobject.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
(...skipping 1293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 // Verify the model. | 1304 // Verify the model. |
1305 const std::wstring expected(L"1b 2f:[ O3f:[ O3f1b O3f2f ] 2f1b 2f2f:[ 2f2f1b " | 1305 const std::wstring expected(L"1b 2f:[ O3f:[ O3f1b O3f2f ] 2f1b 2f2f:[ 2f2f1b " |
1306 "2f2f2b 2f2f3b ] 2f3b ] 3b 4b "); | 1306 "2f2f2b 2f2f3b ] 2f3b ] 3b 4b "); |
1307 actual = model_test_utils::ModelStringFromNode(root); | 1307 actual = model_test_utils::ModelStringFromNode(root); |
1308 EXPECT_EQ(expected, actual); | 1308 EXPECT_EQ(expected, actual); |
1309 | 1309 |
1310 // Now drag over a folder button. | 1310 // Now drag over a folder button. |
1311 targetButton = [folderController buttonWithTitleEqualTo:@"2f2f"]; | 1311 targetButton = [folderController buttonWithTitleEqualTo:@"2f2f"]; |
1312 ASSERT_TRUE(targetButton); | 1312 ASSERT_TRUE(targetButton); |
1313 newNode = other->GetChild(2); // Should be O4f. | 1313 newNode = other->GetChild(2); // Should be O4f. |
1314 EXPECT_EQ(newNode->GetTitle(), L"O4f"); | 1314 EXPECT_EQ(newNode->GetTitleAsString16(), ASCIIToUTF16("O4f")); |
1315 [folderController setDragDataNode:newNode]; | 1315 [folderController setDragDataNode:newNode]; |
1316 [dragInfo setDropLocation:[targetButton center]]; | 1316 [dragInfo setDropLocation:[targetButton center]]; |
1317 [folderController dragBookmarkData:(id<NSDraggingInfo>)dragInfo.get()]; | 1317 [folderController dragBookmarkData:(id<NSDraggingInfo>)dragInfo.get()]; |
1318 | 1318 |
1319 // Verify the model. | 1319 // Verify the model. |
1320 const std::wstring expectedA(L"1b 2f:[ O3f:[ O3f1b O3f2f ] 2f1b 2f2f:[ " | 1320 const std::wstring expectedA(L"1b 2f:[ O3f:[ O3f1b O3f2f ] 2f1b 2f2f:[ " |
1321 "2f2f1b 2f2f2b 2f2f3b O4f:[ O4f1b O4f2f ] ] " | 1321 "2f2f1b 2f2f2b 2f2f3b O4f:[ O4f1b O4f2f ] ] " |
1322 "2f3b ] 3b 4b "); | 1322 "2f3b ] 3b 4b "); |
1323 actual = model_test_utils::ModelStringFromNode(root); | 1323 actual = model_test_utils::ModelStringFromNode(root); |
1324 EXPECT_EQ(expectedA, actual); | 1324 EXPECT_EQ(expectedA, actual); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 [folder deleteBookmark:folder]; | 1452 [folder deleteBookmark:folder]; |
1453 EXPECT_FALSE([folder folderController]); | 1453 EXPECT_FALSE([folder folderController]); |
1454 } | 1454 } |
1455 | 1455 |
1456 // TODO(jrg): draggingEntered: and draggingExited: trigger timers so | 1456 // TODO(jrg): draggingEntered: and draggingExited: trigger timers so |
1457 // they are hard to test. Factor out "fire timers" into routines | 1457 // they are hard to test. Factor out "fire timers" into routines |
1458 // which can be overridden to fire immediately to make behavior | 1458 // which can be overridden to fire immediately to make behavior |
1459 // confirmable. | 1459 // confirmable. |
1460 // There is a similar problem with mouseEnteredButton: and | 1460 // There is a similar problem with mouseEnteredButton: and |
1461 // mouseExitedButton:. | 1461 // mouseExitedButton:. |
OLD | NEW |