| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/scoped_nsobject.h" | 7 #include "base/scoped_nsobject.h" |
| 8 #import "chrome/browser/cocoa/bookmark_editor_controller.h" | 8 #import "chrome/browser/cocoa/bookmark_editor_controller.h" |
| 9 #include "chrome/browser/cocoa/browser_test_helper.h" | 9 #include "chrome/browser/cocoa/browser_test_helper.h" |
| 10 #import "chrome/browser/cocoa/cocoa_test_helper.h" | 10 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 EXPECT_EQ(child->GetTitle(), L"whamma jamma bamma"); | 99 EXPECT_EQ(child->GetTitle(), L"whamma jamma bamma"); |
| 100 EXPECT_EQ(child->GetURL(), GURL("http://yellow-sneakers.com/")); | 100 EXPECT_EQ(child->GetURL(), GURL("http://yellow-sneakers.com/")); |
| 101 | 101 |
| 102 // Give it a URL which needs fixen up to be valid | 102 // Give it a URL which needs fixen up to be valid |
| 103 // (e.g. http:// prefix added) | 103 // (e.g. http:// prefix added) |
| 104 [controller setDisplayURL:@"x"]; | 104 [controller setDisplayURL:@"x"]; |
| 105 [controller ok:nil]; | 105 [controller ok:nil]; |
| 106 child = parent->GetChild(0); | 106 child = parent->GetChild(0); |
| 107 EXPECT_TRUE(child->GetURL().is_valid()); | 107 EXPECT_TRUE(child->GetURL().is_valid()); |
| 108 | 108 |
| 109 // Confirm OK button enabled/disabled as appropriate. | 109 // Confirm OK button enabled/disabled as appropriate: |
| 110 // First test the URL. |
| 110 EXPECT_TRUE([controller okButtonEnabled]); | 111 EXPECT_TRUE([controller okButtonEnabled]); |
| 111 [controller setDisplayURL:@""]; | 112 [controller setDisplayURL:@""]; |
| 112 EXPECT_FALSE([controller okButtonEnabled]); | 113 EXPECT_FALSE([controller okButtonEnabled]); |
| 113 [controller setDisplayURL:@"http://www.cnn.com"]; | 114 [controller setDisplayURL:@"http://www.cnn.com"]; |
| 114 EXPECT_TRUE([controller okButtonEnabled]); | 115 EXPECT_TRUE([controller okButtonEnabled]); |
| 116 // Then test the name. |
| 117 [controller setDisplayName:@""]; |
| 118 EXPECT_FALSE([controller okButtonEnabled]); |
| 119 [controller setDisplayName:@" "]; |
| 120 EXPECT_FALSE([controller okButtonEnabled]); |
| 121 // Then little mix of both. |
| 122 [controller setDisplayName:@"name"]; |
| 123 EXPECT_TRUE([controller okButtonEnabled]); |
| 124 [controller setDisplayURL:@""]; |
| 125 EXPECT_FALSE([controller okButtonEnabled]); |
| 115 } | 126 } |
| OLD | NEW |