Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: ios/chrome/browser/ui/context_menu/context_menu_wrangler_unittest.mm

Issue 1972013003: Add ContextMenuCoordinator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup based on CL comments. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ios/chrome/browser/ui/context_menu/context_menu_wrangler.h"
6
7 #import <UIKit/UIKit.h>
8
9 #include "base/mac/scoped_nsobject.h"
10 #import "ios/web/public/web_state/context_menu_params.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "testing/platform_test.h"
13
14 // Fixture to test ContextMenuWrangler.
15 class ContextMenuWranglerTest : public PlatformTest {
16 public:
17 ContextMenuWranglerTest() {
18 window_.reset(
19 [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]);
20 [window_ makeKeyAndVisible];
21 }
22
23 protected:
24 base::scoped_nsobject<ContextMenuWrangler> menu_wrangler_;
25 base::scoped_nsobject<UIWindow> window_;
26 };
27
28 // Tests the context menu reports as visible after presenting.
29 TEST_F(ContextMenuWranglerTest, DisplayContextMenu) {
30 web::ContextMenuParams params;
31 params.location = CGPointZero;
32 params.view.reset([window_ retain]);
33 menu_wrangler_.reset(
34 [[ContextMenuWrangler alloc] initWithContextMenuParams:params]);
35
36 [menu_wrangler_ addItemWithTitle:@"foo" action:nil];
37 [menu_wrangler_ addItemWithTitle:@"bar"
38 action:^{
39 }];
40
41 [menu_wrangler_ start];
42
43 EXPECT_TRUE([menu_wrangler_ isVisible]);
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698