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

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

Issue 1545243002: Convert Pass()→std::move() in //content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 #include <stdint.h> 5 #include <stdint.h>
6 #include <utility>
6 7
7 #include "base/command_line.h" 8 #include "base/command_line.h"
8 #include "base/logging.h" 9 #include "base/logging.h"
9 #include "base/macros.h" 10 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
11 #include "build/build_config.h" 12 #include "build/build_config.h"
12 #include "content/browser/frame_host/cross_site_transferring_request.h" 13 #include "content/browser/frame_host/cross_site_transferring_request.h"
13 #include "content/browser/frame_host/interstitial_page_impl.h" 14 #include "content/browser/frame_host/interstitial_page_impl.h"
14 #include "content/browser/frame_host/navigation_entry_impl.h" 15 #include "content/browser/frame_host/navigation_entry_impl.h"
15 #include "content/browser/frame_host/render_frame_host_impl.h" 16 #include "content/browser/frame_host/render_frame_host_impl.h"
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 // Restore a navigation entry for URL that should not assign site to the 845 // Restore a navigation entry for URL that should not assign site to the
845 // SiteInstance. 846 // SiteInstance.
846 browser_client.set_assign_site_for_url(false); 847 browser_client.set_assign_site_for_url(false);
847 const GURL native_url("non-site-url://stuffandthings"); 848 const GURL native_url("non-site-url://stuffandthings");
848 std::vector<scoped_ptr<NavigationEntry>> entries; 849 std::vector<scoped_ptr<NavigationEntry>> entries;
849 scoped_ptr<NavigationEntry> new_entry = 850 scoped_ptr<NavigationEntry> new_entry =
850 NavigationControllerImpl::CreateNavigationEntry( 851 NavigationControllerImpl::CreateNavigationEntry(
851 native_url, Referrer(), ui::PAGE_TRANSITION_LINK, false, 852 native_url, Referrer(), ui::PAGE_TRANSITION_LINK, false,
852 std::string(), browser_context()); 853 std::string(), browser_context());
853 new_entry->SetPageID(0); 854 new_entry->SetPageID(0);
854 entries.push_back(new_entry.Pass()); 855 entries.push_back(std::move(new_entry));
855 controller().Restore( 856 controller().Restore(
856 0, 857 0,
857 NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY, 858 NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY,
858 &entries); 859 &entries);
859 ASSERT_EQ(0u, entries.size()); 860 ASSERT_EQ(0u, entries.size());
860 ASSERT_EQ(1, controller().GetEntryCount()); 861 ASSERT_EQ(1, controller().GetEntryCount());
861 862
862 controller().GoToIndex(0); 863 controller().GoToIndex(0);
863 NavigationEntry* entry = controller().GetPendingEntry(); 864 NavigationEntry* entry = controller().GetPendingEntry();
864 orig_rfh->PrepareForCommit(); 865 orig_rfh->PrepareForCommit();
(...skipping 29 matching lines...) Expand all
894 // Restore a navigation entry for a regular URL ensuring that the embedder 895 // Restore a navigation entry for a regular URL ensuring that the embedder
895 // ShouldAssignSiteForUrl override is disabled (i.e. returns true). 896 // ShouldAssignSiteForUrl override is disabled (i.e. returns true).
896 browser_client.set_assign_site_for_url(true); 897 browser_client.set_assign_site_for_url(true);
897 const GURL regular_url("http://www.yahoo.com"); 898 const GURL regular_url("http://www.yahoo.com");
898 std::vector<scoped_ptr<NavigationEntry>> entries; 899 std::vector<scoped_ptr<NavigationEntry>> entries;
899 scoped_ptr<NavigationEntry> new_entry = 900 scoped_ptr<NavigationEntry> new_entry =
900 NavigationControllerImpl::CreateNavigationEntry( 901 NavigationControllerImpl::CreateNavigationEntry(
901 regular_url, Referrer(), ui::PAGE_TRANSITION_LINK, false, 902 regular_url, Referrer(), ui::PAGE_TRANSITION_LINK, false,
902 std::string(), browser_context()); 903 std::string(), browser_context());
903 new_entry->SetPageID(0); 904 new_entry->SetPageID(0);
904 entries.push_back(new_entry.Pass()); 905 entries.push_back(std::move(new_entry));
905 controller().Restore( 906 controller().Restore(
906 0, 907 0,
907 NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY, 908 NavigationController::RESTORE_LAST_SESSION_EXITED_CLEANLY,
908 &entries); 909 &entries);
909 ASSERT_EQ(0u, entries.size()); 910 ASSERT_EQ(0u, entries.size());
910 911
911 ASSERT_EQ(1, controller().GetEntryCount()); 912 ASSERT_EQ(1, controller().GetEntryCount());
912 controller().GoToIndex(0); 913 controller().GoToIndex(0);
913 NavigationEntry* entry = controller().GetPendingEntry(); 914 NavigationEntry* entry = controller().GetPendingEntry();
914 orig_rfh->PrepareForCommit(); 915 orig_rfh->PrepareForCommit();
(...skipping 2457 matching lines...) Expand 10 before | Expand all | Expand 10 after
3372 backend->AllowCertForHost(*cert, test_url.host(), 1); 3373 backend->AllowCertForHost(*cert, test_url.host(), 1);
3373 EXPECT_TRUE(backend->HasAllowException(test_url.host())); 3374 EXPECT_TRUE(backend->HasAllowException(test_url.host()));
3374 3375
3375 contents()->OnDidLoadResourceFromMemoryCache(test_url, "", "GET", "mime type", 3376 contents()->OnDidLoadResourceFromMemoryCache(test_url, "", "GET", "mime type",
3376 RESOURCE_TYPE_MAIN_FRAME); 3377 RESOURCE_TYPE_MAIN_FRAME);
3377 3378
3378 EXPECT_TRUE(backend->HasAllowException(test_url.host())); 3379 EXPECT_TRUE(backend->HasAllowException(test_url.host()));
3379 } 3380 }
3380 3381
3381 } // namespace content 3382 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/browser/web_contents/web_contents_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698