OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/strings/string16.h" | 5 #include "base/strings/string16.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "content/browser/frame_host/navigation_entry_impl.h" | 10 #include "content/browser/frame_host/navigation_entry_impl.h" |
11 #include "content/browser/site_instance_impl.h" | 11 #include "content/browser/site_instance_impl.h" |
12 #include "content/public/common/ssl_status.h" | 12 #include "content/public/common/ssl_status.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 using base::ASCIIToUTF16; | 15 using base::ASCIIToUTF16; |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 class NavigationEntryTest : public testing::Test { | 19 class NavigationEntryTest : public testing::Test { |
20 public: | 20 public: |
21 NavigationEntryTest() : instance_(NULL) { | 21 NavigationEntryTest() : instance_(NULL) { |
22 } | 22 } |
23 | 23 |
24 void SetUp() override { | 24 void SetUp() override { |
25 entry1_.reset(new NavigationEntryImpl); | 25 entry1_.reset(new NavigationEntryImpl); |
26 | 26 |
27 #if !defined(OS_IOS) | |
28 instance_ = static_cast<SiteInstanceImpl*>(SiteInstance::Create(NULL)); | 27 instance_ = static_cast<SiteInstanceImpl*>(SiteInstance::Create(NULL)); |
29 #endif | |
30 entry2_.reset(new NavigationEntryImpl( | 28 entry2_.reset(new NavigationEntryImpl( |
31 instance_, 3, | 29 instance_, 3, |
32 GURL("test:url"), | 30 GURL("test:url"), |
33 Referrer(GURL("from"), blink::WebReferrerPolicyDefault), | 31 Referrer(GURL("from"), blink::WebReferrerPolicyDefault), |
34 ASCIIToUTF16("title"), | 32 ASCIIToUTF16("title"), |
35 ui::PAGE_TRANSITION_TYPED, | 33 ui::PAGE_TRANSITION_TYPED, |
36 false)); | 34 false)); |
37 } | 35 } |
38 | 36 |
39 void TearDown() override {} | 37 void TearDown() override {} |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // Content in |output| is not modified if data is not present at the key. | 273 // Content in |output| is not modified if data is not present at the key. |
276 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output)); | 274 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output)); |
277 EXPECT_EQ(test_data, output); | 275 EXPECT_EQ(test_data, output); |
278 // Using an empty string shows that the data is not present in the map. | 276 // Using an empty string shows that the data is not present in the map. |
279 base::string16 output2; | 277 base::string16 output2; |
280 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output2)); | 278 EXPECT_FALSE(entry1_->GetExtraData("search_terms", &output2)); |
281 EXPECT_EQ(ASCIIToUTF16(""), output2); | 279 EXPECT_EQ(ASCIIToUTF16(""), output2); |
282 } | 280 } |
283 | 281 |
284 } // namespace content | 282 } // namespace content |
OLD | NEW |