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

Side by Side Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 2527133002: Remove some WebContents::GetRenderViewHost() calls. (Closed)
Patch Set: Created 4 years 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 #include <stdint.h> 5 #include <stdint.h>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 2603 matching lines...) Expand 10 before | Expand all | Expand 10 after
2614 url_from_ipc, 1, base::string16(), false); 2614 url_from_ipc, 1, base::string16(), false);
2615 EXPECT_EQ(url_normalized, other_observer.last_url()); 2615 EXPECT_EQ(url_normalized, other_observer.last_url());
2616 } 2616 }
2617 2617
2618 // Test that if a pending contents is deleted before it is shown, we don't 2618 // Test that if a pending contents is deleted before it is shown, we don't
2619 // crash. 2619 // crash.
2620 TEST_F(WebContentsImplTest, PendingContents) { 2620 TEST_F(WebContentsImplTest, PendingContents) {
2621 std::unique_ptr<TestWebContents> other_contents( 2621 std::unique_ptr<TestWebContents> other_contents(
2622 static_cast<TestWebContents*>(CreateTestWebContents())); 2622 static_cast<TestWebContents*>(CreateTestWebContents()));
2623 contents()->AddPendingContents(other_contents.get()); 2623 contents()->AddPendingContents(other_contents.get());
2624 int process_id = other_contents->GetRenderViewHost()->GetProcess()->GetID(); 2624 int process_id = other_contents->GetMainFrame()->GetProcess()->GetID();
2625 int route_id = other_contents->GetRenderViewHost()->GetRoutingID(); 2625 int route_id = other_contents->GetRenderViewHost()->GetRoutingID();
2626 other_contents.reset(); 2626 other_contents.reset();
2627 EXPECT_EQ(nullptr, contents()->GetCreatedWindow(process_id, route_id)); 2627 EXPECT_EQ(nullptr, contents()->GetCreatedWindow(process_id, route_id));
2628 } 2628 }
2629 2629
2630 TEST_F(WebContentsImplTest, CapturerOverridesPreferredSize) { 2630 TEST_F(WebContentsImplTest, CapturerOverridesPreferredSize) {
2631 const gfx::Size original_preferred_size(1024, 768); 2631 const gfx::Size original_preferred_size(1024, 768);
2632 contents()->UpdatePreferredSize(original_preferred_size); 2632 contents()->UpdatePreferredSize(original_preferred_size);
2633 2633
2634 // With no capturers, expect the preferred size to be the one propagated into 2634 // With no capturers, expect the preferred size to be the one propagated into
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
3415 // An automatic navigation. 3415 // An automatic navigation.
3416 main_test_rfh()->SendNavigateWithModificationCallback( 3416 main_test_rfh()->SendNavigateWithModificationCallback(
3417 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); 3417 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture));
3418 3418
3419 EXPECT_EQ(1u, dialog_manager.reset_count()); 3419 EXPECT_EQ(1u, dialog_manager.reset_count());
3420 3420
3421 contents()->SetJavaScriptDialogManagerForTesting(nullptr); 3421 contents()->SetJavaScriptDialogManagerForTesting(nullptr);
3422 } 3422 }
3423 3423
3424 } // namespace content 3424 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698