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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm

Issue 2375663002: Replace MessageLoop::current()->task_runner() with ThreadTaskRunnerHandle::Get(). (Closed)
Patch Set: rebase Created 4 years, 2 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_mac_editcommand_h elper.h" 5 #import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_h elper.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include "base/mac/scoped_nsautorelease_pool.h" 11 #include "base/mac/scoped_nsautorelease_pool.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/threading/thread_task_runner_handle.h"
13 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " 14 #include "content/browser/compositor/test/no_transport_image_transport_factory.h "
14 #include "content/browser/gpu/compositor_util.h" 15 #include "content/browser/gpu/compositor_util.h"
15 #include "content/browser/renderer_host/render_widget_host_delegate.h" 16 #include "content/browser/renderer_host/render_widget_host_delegate.h"
16 #include "content/browser/renderer_host/render_widget_host_impl.h" 17 #include "content/browser/renderer_host/render_widget_host_impl.h"
17 #include "content/common/input_messages.h" 18 #include "content/common/input_messages.h"
18 #include "content/public/test/mock_render_process_host.h" 19 #include "content/public/test/mock_render_process_host.h"
19 #include "content/public/test/test_browser_context.h" 20 #include "content/public/test/test_browser_context.h"
20 #include "testing/gmock/include/gmock/gmock.h" 21 #include "testing/gmock/include/gmock/gmock.h"
21 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
22 #include "testing/platform_test.h" 23 #include "testing/platform_test.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 ui::test::ScopedSetSupportedScaleFactors scoped_supported(supported_factors); 129 ui::test::ScopedSetSupportedScaleFactors scoped_supported(supported_factors);
129 130
130 int32_t routing_id = process_host.GetNextRoutingID(); 131 int32_t routing_id = process_host.GetNextRoutingID();
131 RenderWidgetHostEditCommandCounter* render_widget = 132 RenderWidgetHostEditCommandCounter* render_widget =
132 new RenderWidgetHostEditCommandCounter(&delegate, &process_host, 133 new RenderWidgetHostEditCommandCounter(&delegate, &process_host,
133 routing_id); 134 routing_id);
134 135
135 base::mac::ScopedNSAutoreleasePool pool; 136 base::mac::ScopedNSAutoreleasePool pool;
136 137
137 base::MessageLoop message_loop; 138 base::MessageLoop message_loop;
138 ui::WindowResizeHelperMac::Get()->Init( 139 ui::WindowResizeHelperMac::Get()->Init(base::ThreadTaskRunnerHandle::Get());
139 base::MessageLoop::current()->task_runner());
140 140
141 // Owned by its |cocoa_view()|, i.e. |rwhv_cocoa|. 141 // Owned by its |cocoa_view()|, i.e. |rwhv_cocoa|.
142 RenderWidgetHostViewMac* rwhv_mac = new RenderWidgetHostViewMac( 142 RenderWidgetHostViewMac* rwhv_mac = new RenderWidgetHostViewMac(
143 render_widget, false); 143 render_widget, false);
144 base::scoped_nsobject<RenderWidgetHostViewCocoa> rwhv_cocoa( 144 base::scoped_nsobject<RenderWidgetHostViewCocoa> rwhv_cocoa(
145 [rwhv_mac->cocoa_view() retain]); 145 [rwhv_mac->cocoa_view() retain]);
146 146
147 RenderWidgetHostViewMacEditCommandHelper helper; 147 RenderWidgetHostViewMacEditCommandHelper helper;
148 NSArray* edit_command_strings = helper.GetEditSelectorNames(); 148 NSArray* edit_command_strings = helper.GetEditSelectorNames();
149 RenderWidgetHostViewMacOwner* rwhwvm_owner = 149 RenderWidgetHostViewMacOwner* rwhwvm_owner =
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 210
211 // Random selectors should be enabled by the function. 211 // Random selectors should be enabled by the function.
212 SEL garbage_selector = NSSelectorFromString(@"randomGarbageSelector:"); 212 SEL garbage_selector = NSSelectorFromString(@"randomGarbageSelector:");
213 ASSERT_FALSE(helper.IsMenuItemEnabled(garbage_selector, rwhvm_owner)); 213 ASSERT_FALSE(helper.IsMenuItemEnabled(garbage_selector, rwhvm_owner));
214 214
215 // TODO(jeremy): Currently IsMenuItemEnabled just returns true for all edit 215 // TODO(jeremy): Currently IsMenuItemEnabled just returns true for all edit
216 // selectors. Once we go past that we should do more extensive testing here. 216 // selectors. Once we go past that we should do more extensive testing here.
217 } 217 }
218 218
219 } // namespace content 219 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698