| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "ios/clean/chrome/browser/ui/tools/tools_mediator.h" | 5 #import "ios/clean/chrome/browser/ui/tools/tools_mediator.h" |
| 6 | 6 |
| 7 #import "ios/clean/chrome/browser/ui/tools/tools_consumer.h" | 7 #import "ios/clean/chrome/browser/ui/tools/tools_consumer.h" |
| 8 #import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h" |
| 8 #include "testing/platform_test.h" | 9 #include "testing/platform_test.h" |
| 9 #import "third_party/ocmock/OCMock/OCMock.h" | 10 #import "third_party/ocmock/OCMock/OCMock.h" |
| 10 #include "third_party/ocmock/gtest_support.h" | 11 #include "third_party/ocmock/gtest_support.h" |
| 11 | 12 |
| 12 #if !defined(__has_feature) || !__has_feature(objc_arc) | 13 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 13 #error "This file requires ARC support." | 14 #error "This file requires ARC support." |
| 14 #endif | 15 #endif |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 class ToolsMediatorTest : public PlatformTest { | 19 class ToolsMediatorTest : public PlatformTest { |
| 19 protected: | 20 protected: |
| 20 ToolsMediator* mediator_; | 21 ToolsMediator* mediator_; |
| 21 }; | 22 }; |
| 22 | 23 |
| 23 TEST_F(ToolsMediatorTest, TestSetConsumer) { | 24 TEST_F(ToolsMediatorTest, TestSetConsumer) { |
| 24 id consumer = OCMProtocolMock(@protocol(ToolsConsumer)); | 25 id consumer = OCMProtocolMock(@protocol(ToolsConsumer)); |
| 25 mediator_ = [[ToolsMediator alloc] initWithConsumer:consumer]; | 26 id configuration = OCMClassMock([ToolsMenuConfiguration class]); |
| 27 OCMStub([configuration isInTabSwitcher]).andReturn(YES); |
| 28 |
| 29 mediator_ = [[ToolsMediator alloc] initWithConsumer:consumer |
| 30 andConfiguration:configuration]; |
| 26 | 31 |
| 27 [[consumer verify] setToolsMenuItems:[OCMArg any]]; | 32 [[consumer verify] setToolsMenuItems:[OCMArg any]]; |
| 33 [[consumer verify] setDisplayOverflowControls:NO]; |
| 28 } | 34 } |
| 29 | 35 |
| 30 } // namespace | 36 } // namespace |
| OLD | NEW |