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

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

Issue 2112923002: Fix crash when destroying a RenderWidgetHost that holds the pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/text_input_client_mac.h" 5 #import "content/browser/renderer_host/text_input_client_mac.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 18 matching lines...) Expand all
29 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { 29 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate {
30 public: 30 public:
31 MockRenderWidgetHostDelegate() {} 31 MockRenderWidgetHostDelegate() {}
32 ~MockRenderWidgetHostDelegate() override {} 32 ~MockRenderWidgetHostDelegate() override {}
33 33
34 private: 34 private:
35 void Cut() override {} 35 void Cut() override {}
36 void Copy() override {} 36 void Copy() override {}
37 void Paste() override {} 37 void Paste() override {}
38 void SelectAll() override {} 38 void SelectAll() override {}
39 bool HasMouseLock(RenderWidgetHostImpl*) override { return false; }
39 }; 40 };
40 41
41 // This test does not test the WebKit side of the dictionary system (which 42 // This test does not test the WebKit side of the dictionary system (which
42 // performs the actual data fetching), but rather this just tests that the 43 // performs the actual data fetching), but rather this just tests that the
43 // service's signaling system works. 44 // service's signaling system works.
44 class TextInputClientMacTest : public testing::Test { 45 class TextInputClientMacTest : public testing::Test {
45 public: 46 public:
46 TextInputClientMacTest() 47 TextInputClientMacTest()
47 : browser_context_(), 48 : browser_context_(),
48 process_factory_(), 49 process_factory_(),
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 197
197 TEST_F(TextInputClientMacTest, TimeoutRectForRange) { 198 TEST_F(TextInputClientMacTest, TimeoutRectForRange) {
198 NSRect rect = service()->GetFirstRectForRange(widget(), NSMakeRange(0, 32)); 199 NSRect rect = service()->GetFirstRectForRange(widget(), NSMakeRange(0, 32));
199 EXPECT_EQ(1U, ipc_sink().message_count()); 200 EXPECT_EQ(1U, ipc_sink().message_count());
200 EXPECT_TRUE(ipc_sink().GetUniqueMessageMatching( 201 EXPECT_TRUE(ipc_sink().GetUniqueMessageMatching(
201 TextInputClientMsg_FirstRectForCharacterRange::ID)); 202 TextInputClientMsg_FirstRectForCharacterRange::ID));
202 EXPECT_NSEQ(NSZeroRect, rect); 203 EXPECT_NSEQ(NSZeroRect, rect);
203 } 204 }
204 205
205 } // namespace content 206 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698