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

Side by Side Diff: url/origin_unittest.cc

Issue 2691393002: Fix auto raw pointer deduction on linux (Closed)
Patch Set: rebase Created 3 years, 10 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/views/test/ui_controls_factory_desktop_aurax11.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 std::stringstream out; 255 std::stringstream out;
256 out << origin; 256 out << origin;
257 EXPECT_EQ(test_case.expected, out.str()); 257 EXPECT_EQ(test_case.expected, out.str());
258 } 258 }
259 259
260 const char* const failure_cases[] = { 260 const char* const failure_cases[] = {
261 "http-so://.", "http-so://foo", "http-so://.foo", "http-so://foo.", 261 "http-so://.", "http-so://foo", "http-so://.foo", "http-so://foo.",
262 "https-so://.", "https-so://foo", "https-so://.foo", "https-so://foo.", 262 "https-so://.", "https-so://foo", "https-so://.foo", "https-so://foo.",
263 }; 263 };
264 264
265 for (const auto& test_case : failure_cases) { 265 for (auto* test_case : failure_cases) {
266 SCOPED_TRACE(test_case); 266 SCOPED_TRACE(test_case);
267 GURL url(test_case); 267 GURL url(test_case);
268 EXPECT_TRUE(url.is_valid()); 268 EXPECT_TRUE(url.is_valid());
269 url::Origin origin(url); 269 url::Origin origin(url);
270 std::string serialized = origin.Serialize(); 270 std::string serialized = origin.Serialize();
271 std::string serialized_physical_origin = 271 std::string serialized_physical_origin =
272 origin.GetPhysicalOrigin().Serialize(); 272 origin.GetPhysicalOrigin().Serialize();
273 EXPECT_TRUE(origin.unique()); 273 EXPECT_TRUE(origin.unique());
274 EXPECT_EQ("", origin.suborigin()); 274 EXPECT_EQ("", origin.suborigin());
275 ExpectParsedUrlsEqual(GURL(serialized), origin.GetURL()); 275 ExpectParsedUrlsEqual(GURL(serialized), origin.GetURL());
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 GURL invalid_url("google.com"); 492 GURL invalid_url("google.com");
493 ASSERT_FALSE(invalid_url.is_valid()); 493 ASSERT_FALSE(invalid_url.is_valid());
494 EXPECT_FALSE(url::Origin(invalid_url).DomainIs("google.com")); 494 EXPECT_FALSE(url::Origin(invalid_url).DomainIs("google.com"));
495 495
496 // Unique origins. 496 // Unique origins.
497 EXPECT_FALSE(url::Origin().DomainIs("")); 497 EXPECT_FALSE(url::Origin().DomainIs(""));
498 EXPECT_FALSE(url::Origin().DomainIs("com")); 498 EXPECT_FALSE(url::Origin().DomainIs("com"));
499 } 499 }
500 500
501 } // namespace url 501 } // namespace url
OLDNEW
« no previous file with comments | « ui/views/test/ui_controls_factory_desktop_aurax11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698