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

Side by Side Diff: chrome/browser/apps/web_view_interactive_browsertest.cc

Issue 444813002: Remove BrowserPlugin's -internal-attach method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't crash on tear down Created 6 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "apps/app_window.h" 5 #include "apps/app_window.h"
6 #include "apps/app_window_registry.h" 6 #include "apps/app_window_registry.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/apps/app_browsertest_util.h" 10 #include "chrome/browser/apps/app_browsertest_util.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 message_loop_runner_ = new content::MessageLoopRunner; 48 message_loop_runner_ = new content::MessageLoopRunner;
49 message_loop_runner_->Run(); 49 message_loop_runner_->Run();
50 return web_contents_; 50 return web_contents_;
51 } 51 }
52 52
53 private: 53 private:
54 // GuestViewManager override: 54 // GuestViewManager override:
55 virtual void AddGuest(int guest_instance_id, 55 virtual void AddGuest(int guest_instance_id,
56 content::WebContents* guest_web_contents) OVERRIDE{ 56 content::WebContents* guest_web_contents) OVERRIDE{
57 extensions::GuestViewManager::AddGuest( 57 GuestViewManager::AddGuest(guest_instance_id, guest_web_contents);
58 guest_instance_id, guest_web_contents);
59 web_contents_ = guest_web_contents; 58 web_contents_ = guest_web_contents;
60 59
61 if (message_loop_runner_) 60 if (message_loop_runner_)
62 message_loop_runner_->Quit(); 61 message_loop_runner_->Quit();
63 } 62 }
64 63
65 content::WebContents* web_contents_; 64 content::WebContents* web_contents_;
66 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; 65 scoped_refptr<content::MessageLoopRunner> message_loop_runner_;
67 }; 66 };
68 67
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 mouse_event.modifiers = 0; 326 mouse_event.modifiers = 0;
328 327
329 mouse_event.type = blink::WebInputEvent::MouseDown; 328 mouse_event.type = blink::WebInputEvent::MouseDown;
330 rwh->ForwardMouseEvent(mouse_event); 329 rwh->ForwardMouseEvent(mouse_event);
331 mouse_event.type = blink::WebInputEvent::MouseUp; 330 mouse_event.type = blink::WebInputEvent::MouseUp;
332 rwh->ForwardMouseEvent(mouse_event); 331 rwh->ForwardMouseEvent(mouse_event);
333 } 332 }
334 333
335 class PopupCreatedObserver { 334 class PopupCreatedObserver {
336 public: 335 public:
337 explicit PopupCreatedObserver() 336 PopupCreatedObserver()
338 : initial_widget_count_(0), 337 : initial_widget_count_(0),
339 last_render_widget_host_(NULL), 338 last_render_widget_host_(NULL),
340 seen_new_widget_(false) {} 339 seen_new_widget_(false) {}
341 340
342 ~PopupCreatedObserver() {} 341 ~PopupCreatedObserver() {}
343 342
344 void Wait() { 343 void Wait() {
345 size_t current_widget_count = CountWidgets(); 344 size_t current_widget_count = CountWidgets();
346 if (!seen_new_widget_ && 345 if (!seen_new_widget_ &&
347 current_widget_count == initial_widget_count_ + 1) { 346 current_widget_count == initial_widget_count_ + 1) {
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 1100
1102 // Now verify that the selection text propagates properly to RWHV. 1101 // Now verify that the selection text propagates properly to RWHV.
1103 content::RenderWidgetHostView* guest_rwhv = 1102 content::RenderWidgetHostView* guest_rwhv =
1104 guest_web_contents()->GetRenderWidgetHostView(); 1103 guest_web_contents()->GetRenderWidgetHostView();
1105 ASSERT_TRUE(guest_rwhv); 1104 ASSERT_TRUE(guest_rwhv);
1106 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); 1105 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText());
1107 ASSERT_TRUE(selected_text.size() >= 10u); 1106 ASSERT_TRUE(selected_text.size() >= 10u);
1108 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); 1107 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10));
1109 } 1108 }
1110 #endif 1109 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698