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

Side by Side Diff: ui/views/controls/webview/webview_unittest.cc

Issue 1917053003: unique_ptr_migration: clean up references to scoped_ptr as of r389721 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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
« no previous file with comments | « ui/snapshot/snapshot_android.cc ('k') | ui/wm/core/cursor_manager_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/views/controls/webview/webview.h" 5 #include "ui/views/controls/webview/webview.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 OnMousePressed(click_inside_holder)); 460 OnMousePressed(click_inside_holder));
461 EXPECT_FALSE(web_view()->HasFocus()); 461 EXPECT_FALSE(web_view()->HasFocus());
462 EXPECT_FALSE(holder()->HasFocus()); 462 EXPECT_FALSE(holder()->HasFocus());
463 EXPECT_TRUE(something_to_focus->HasFocus()); 463 EXPECT_TRUE(something_to_focus->HasFocus());
464 } 464 }
465 465
466 // Verifies that there is no crash in WebView destructor 466 // Verifies that there is no crash in WebView destructor
467 // if WebView is already removed from Widget. 467 // if WebView is already removed from Widget.
468 TEST_F(WebViewUnitTest, DetachedWebViewDestructor) { 468 TEST_F(WebViewUnitTest, DetachedWebViewDestructor) {
469 // Init WebView with attached NativeView. 469 // Init WebView with attached NativeView.
470 const scoped_ptr<content::WebContents> web_contents(CreateWebContents()); 470 const std::unique_ptr<content::WebContents> web_contents(CreateWebContents());
471 scoped_ptr<WebView> webview(new WebView(web_contents->GetBrowserContext())); 471 std::unique_ptr<WebView> webview(
472 new WebView(web_contents->GetBrowserContext()));
472 View* contents_view = top_level_widget()->GetContentsView(); 473 View* contents_view = top_level_widget()->GetContentsView();
473 contents_view->AddChildView(webview.get()); 474 contents_view->AddChildView(webview.get());
474 webview->SetWebContents(web_contents.get()); 475 webview->SetWebContents(web_contents.get());
475 476
476 // Remove WebView from views hierarchy. NativeView should be detached 477 // Remove WebView from views hierarchy. NativeView should be detached
477 // from Widget. 478 // from Widget.
478 contents_view->RemoveChildView(webview.get()); 479 contents_view->RemoveChildView(webview.get());
479 // Destroy WebView. NativeView should be detached secondary. 480 // Destroy WebView. NativeView should be detached secondary.
480 // There should be no crash. 481 // There should be no crash.
481 webview.reset(); 482 webview.reset();
482 } 483 }
483 484
484 } // namespace views 485 } // namespace views
OLDNEW
« no previous file with comments | « ui/snapshot/snapshot_android.cc ('k') | ui/wm/core/cursor_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698