OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/ui/cocoa/autofill/autofill_sign_in_container.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_sign_in_container.h" |
6 | 6 |
7 #include "base/memory/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h" | 8 #include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h" |
9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
11 #include "chrome/test/base/testing_profile.h" | 11 #include "chrome/test/base/testing_profile.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 #include "content/public/browser/web_contents_view.h" | 13 #include "content/public/browser/web_contents_view.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "testing/platform_test.h" | 15 #include "testing/platform_test.h" |
16 #import "ui/base/test/ui_cocoa_test_helper.h" | 16 #import "ui/base/test/ui_cocoa_test_helper.h" |
17 | 17 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 if (base::debug::BeingDebugged()) { | 53 if (base::debug::BeingDebugged()) { |
54 [test_window_ orderFront:nil]; | 54 [test_window_ orderFront:nil]; |
55 } else { | 55 } else { |
56 [test_window_ orderBack:nil]; | 56 [test_window_ orderBack:nil]; |
57 } | 57 } |
58 } | 58 } |
59 return test_window_; | 59 return test_window_; |
60 } | 60 } |
61 | 61 |
62 protected: | 62 protected: |
63 scoped_nsobject<AutofillSignInContainer> container_; | 63 base::scoped_nsobject<AutofillSignInContainer> container_; |
64 testing::NiceMock<autofill::MockAutofillDialogController> controller_; | 64 testing::NiceMock<autofill::MockAutofillDialogController> controller_; |
65 CocoaTestHelperWindow* test_window_; | 65 CocoaTestHelperWindow* test_window_; |
66 }; | 66 }; |
67 | 67 |
68 } // namespace | 68 } // namespace |
69 | 69 |
70 TEST_VIEW(AutofillSignInContainerTest, [container_ view]) | 70 TEST_VIEW(AutofillSignInContainerTest, [container_ view]) |
71 | 71 |
72 TEST_F(AutofillSignInContainerTest, Subviews) { | 72 TEST_F(AutofillSignInContainerTest, Subviews) { |
73 // isKindOfClass would be the better choice, but | 73 // isKindOfClass would be the better choice, but |
74 // WebContentsViewCocoaClass is defined in content, and not public. | 74 // WebContentsViewCocoaClass is defined in content, and not public. |
75 bool hasWebView =[[container_ view] isEqual: | 75 bool hasWebView =[[container_ view] isEqual: |
76 [container_ webContents]->GetView()->GetNativeView()]; | 76 [container_ webContents]->GetView()->GetNativeView()]; |
77 | 77 |
78 EXPECT_TRUE(hasWebView); | 78 EXPECT_TRUE(hasWebView); |
79 } | 79 } |
OLD | NEW |