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

Side by Side Diff: chrome/browser/ui/website_settings/website_settings_unittest.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 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 "chrome/browser/ui/website_settings/website_settings.h" 5 #include "chrome/browser/ui/website_settings/website_settings.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 website_settings_.reset(); 110 website_settings_.reset();
111 } 111 }
112 112
113 void SetDefaultUIExpectations(MockWebsiteSettingsUI* mock_ui) { 113 void SetDefaultUIExpectations(MockWebsiteSettingsUI* mock_ui) {
114 // During creation |WebsiteSettings| makes the following calls to the ui. 114 // During creation |WebsiteSettings| makes the following calls to the ui.
115 EXPECT_CALL(*mock_ui, SetPermissionInfo(_)); 115 EXPECT_CALL(*mock_ui, SetPermissionInfo(_));
116 EXPECT_CALL(*mock_ui, SetIdentityInfo(_)); 116 EXPECT_CALL(*mock_ui, SetIdentityInfo(_));
117 EXPECT_CALL(*mock_ui, SetCookieInfo(_)); 117 EXPECT_CALL(*mock_ui, SetCookieInfo(_));
118 } 118 }
119 119
120 void SetURL(std::string url) { url_ = GURL(url); } 120 void SetURL(const std::string& url) { url_ = GURL(url); }
121 121
122 const GURL& url() const { return url_; } 122 const GURL& url() const { return url_; }
123 MockCertStore* cert_store() { return &cert_store_; } 123 MockCertStore* cert_store() { return &cert_store_; }
124 int cert_id() { return cert_id_; } 124 int cert_id() { return cert_id_; }
125 MockWebsiteSettingsUI* mock_ui() { return mock_ui_.get(); } 125 MockWebsiteSettingsUI* mock_ui() { return mock_ui_.get(); }
126 const SecurityStateModel::SecurityInfo& security_info() { 126 const SecurityStateModel::SecurityInfo& security_info() {
127 return security_info_; 127 return security_info_;
128 } 128 }
129 TabSpecificContentSettings* tab_specific_content_settings() { 129 TabSpecificContentSettings* tab_specific_content_settings() {
130 return TabSpecificContentSettings::FromWebContents(web_contents()); 130 return TabSpecificContentSettings::FromWebContents(web_contents());
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 520
521 TEST_F(WebsiteSettingsTest, InternalPage) { 521 TEST_F(WebsiteSettingsTest, InternalPage) {
522 SetURL("chrome://bookmarks"); 522 SetURL("chrome://bookmarks");
523 SetDefaultUIExpectations(mock_ui()); 523 SetDefaultUIExpectations(mock_ui());
524 EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE, 524 EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE,
525 website_settings()->site_connection_status()); 525 website_settings()->site_connection_status());
526 EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE, 526 EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE,
527 website_settings()->site_identity_status()); 527 website_settings()->site_identity_status());
528 EXPECT_EQ(base::string16(), website_settings()->organization_name()); 528 EXPECT_EQ(base::string16(), website_settings()->organization_name());
529 } 529 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698