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

Side by Side Diff: components/navigation_interception/intercept_navigation_throttle_unittest.cc

Issue 2485253002: Remove unnecessary calls to GURL() (Closed)
Patch Set: Assert that StringPiece must always be canonicalized. Fix some constants. Created 4 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/navigation_interception/intercept_navigation_throttle.h" 5 #include "components/navigation_interception/intercept_navigation_throttle.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 19 matching lines...) Expand all
30 30
31 const char kTestUrl[] = "http://www.test.com/"; 31 const char kTestUrl[] = "http://www.test.com/";
32 32
33 // The MS C++ compiler complains about not being able to resolve which url() 33 // The MS C++ compiler complains about not being able to resolve which url()
34 // method (const or non-const) to use if we use the Property matcher to check 34 // method (const or non-const) to use if we use the Property matcher to check
35 // the return value of the NavigationParams::url() method. 35 // the return value of the NavigationParams::url() method.
36 // It is possible to suppress the error by specifying the types directly but 36 // It is possible to suppress the error by specifying the types directly but
37 // that results in very ugly syntax, which is why these custom matchers are 37 // that results in very ugly syntax, which is why these custom matchers are
38 // used instead. 38 // used instead.
39 MATCHER(NavigationParamsUrlIsTest, "") { 39 MATCHER(NavigationParamsUrlIsTest, "") {
40 return arg.url() == GURL(kTestUrl); 40 return arg.url() == kTestUrl;
41 } 41 }
42 42
43 } // namespace 43 } // namespace
44 44
45 // MockInterceptCallbackReceiver ---------------------------------------------- 45 // MockInterceptCallbackReceiver ----------------------------------------------
46 46
47 class MockInterceptCallbackReceiver { 47 class MockInterceptCallbackReceiver {
48 public: 48 public:
49 MOCK_METHOD2(ShouldIgnoreNavigation, 49 MOCK_METHOD2(ShouldIgnoreNavigation,
50 bool(content::WebContents* source, 50 bool(content::WebContents* source,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 ShouldIgnoreNavigation( 155 ShouldIgnoreNavigation(
156 _, AllOf(NavigationParamsUrlIsTest(), 156 _, AllOf(NavigationParamsUrlIsTest(),
157 Property(&NavigationParams::is_post, Eq(false))))) 157 Property(&NavigationParams::is_post, Eq(false)))))
158 .WillOnce(Return(false)); 158 .WillOnce(Return(false));
159 NavigationThrottle::ThrottleCheckResult result = Simulate302(); 159 NavigationThrottle::ThrottleCheckResult result = Simulate302();
160 160
161 EXPECT_EQ(NavigationThrottle::PROCEED, result); 161 EXPECT_EQ(NavigationThrottle::PROCEED, result);
162 } 162 }
163 163
164 } // namespace navigation_interception 164 } // namespace navigation_interception
OLDNEW
« no previous file with comments | « components/history/core/test/fake_web_history_service.cc ('k') | components/ntp_snippets/remote/ntp_snippets_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698