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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram_base.h" | 8 #include "base/metrics/histogram_base.h" |
9 #include "base/metrics/histogram_samples.h" | 9 #include "base/metrics/histogram_samples.h" |
10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 #include "content/public/test/browser_test_utils.h" | 72 #include "content/public/test/browser_test_utils.h" |
73 #include "content/public/test/test_utils.h" | 73 #include "content/public/test/test_utils.h" |
74 #include "grit/generated_resources.h" | 74 #include "grit/generated_resources.h" |
75 #include "net/base/network_change_notifier.h" | 75 #include "net/base/network_change_notifier.h" |
76 #include "net/http/http_status_code.h" | 76 #include "net/http/http_status_code.h" |
77 #include "net/url_request/test_url_fetcher_factory.h" | 77 #include "net/url_request/test_url_fetcher_factory.h" |
78 #include "net/url_request/url_fetcher_impl.h" | 78 #include "net/url_request/url_fetcher_impl.h" |
79 #include "net/url_request/url_request_status.h" | 79 #include "net/url_request/url_request_status.h" |
80 #include "testing/gmock/include/gmock/gmock.h" | 80 #include "testing/gmock/include/gmock/gmock.h" |
81 #include "third_party/skia/include/core/SkBitmap.h" | 81 #include "third_party/skia/include/core/SkBitmap.h" |
82 #include "ui/base/l10n/l10n_util.h" | |
83 | 82 |
84 using base::ASCIIToUTF16; | 83 using base::ASCIIToUTF16; |
85 using testing::HasSubstr; | 84 using testing::HasSubstr; |
86 | 85 |
87 namespace { | 86 namespace { |
88 | 87 |
89 // Task used to make sure history has finished processing a request. Intended | 88 // Task used to make sure history has finished processing a request. Intended |
90 // for use with BlockUntilHistoryProcessesPendingRequests. | 89 // for use with BlockUntilHistoryProcessesPendingRequests. |
91 class QuittingHistoryDBTask : public history::HistoryDBTask { | 90 class QuittingHistoryDBTask : public history::HistoryDBTask { |
92 public: | 91 public: |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 stream << "link.href = \"" << result_url.spec() << "\";"; | 976 stream << "link.href = \"" << result_url.spec() << "\";"; |
978 stream << "document.body.appendChild(link);"; | 977 stream << "document.body.appendChild(link);"; |
979 stream << "link.click();"; | 978 stream << "link.click();"; |
980 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); | 979 EXPECT_TRUE(content::ExecuteScript(contents, stream.str())); |
981 | 980 |
982 content::WaitForLoadStop(contents); | 981 content::WaitForLoadStop(contents); |
983 std::string expected_title = | 982 std::string expected_title = |
984 "Referrer is " + instant_url().GetWithEmptyPath().spec(); | 983 "Referrer is " + instant_url().GetWithEmptyPath().spec(); |
985 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); | 984 EXPECT_EQ(ASCIIToUTF16(expected_title), contents->GetTitle()); |
986 } | 985 } |
OLD | NEW |