| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/google/core/browser/google_url_tracker.h" | 5 #include "components/google/core/browser/google_url_tracker.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 171 } |
| 172 | 172 |
| 173 void TestGoogleURLTrackerNavigationHelper::OpenURL( | 173 void TestGoogleURLTrackerNavigationHelper::OpenURL( |
| 174 GURL url, | 174 GURL url, |
| 175 WindowOpenDisposition disposition, | 175 WindowOpenDisposition disposition, |
| 176 bool user_clicked_on_link) { | 176 bool user_clicked_on_link) { |
| 177 } | 177 } |
| 178 | 178 |
| 179 // TestInfoBarManager --------------------------------------------------------- | 179 // TestInfoBarManager --------------------------------------------------------- |
| 180 | 180 |
| 181 const infobars::InfoBarConstants kTestInfoBarConstants = { |
| 182 1, // separator_line_height |
| 183 36, // default_bar_target_height |
| 184 9, // default_arrow_target_height |
| 185 24, // maximum_arrow_target_height |
| 186 9, // default_arrow_target_half_width |
| 187 14, // maximum_arrow_target_half_width |
| 188 }; |
| 189 |
| 181 class TestInfoBarManager : public infobars::InfoBarManager { | 190 class TestInfoBarManager : public infobars::InfoBarManager { |
| 182 public: | 191 public: |
| 183 explicit TestInfoBarManager(int unique_id); | 192 explicit TestInfoBarManager(int unique_id); |
| 184 ~TestInfoBarManager() override; | 193 ~TestInfoBarManager() override; |
| 185 int GetActiveEntryID() override; | 194 int GetActiveEntryID() override; |
| 195 const infobars::InfoBarConstants& GetInfoBarConstants() const override; |
| 186 | 196 |
| 187 private: | 197 private: |
| 188 int unique_id_; | 198 int unique_id_; |
| 189 DISALLOW_COPY_AND_ASSIGN(TestInfoBarManager); | 199 DISALLOW_COPY_AND_ASSIGN(TestInfoBarManager); |
| 190 }; | 200 }; |
| 191 | 201 |
| 192 TestInfoBarManager::TestInfoBarManager(int unique_id) : unique_id_(unique_id) { | 202 TestInfoBarManager::TestInfoBarManager(int unique_id) : unique_id_(unique_id) { |
| 193 } | 203 } |
| 194 | 204 |
| 195 TestInfoBarManager::~TestInfoBarManager() { | 205 TestInfoBarManager::~TestInfoBarManager() { |
| 196 ShutDown(); | 206 ShutDown(); |
| 197 } | 207 } |
| 198 | 208 |
| 199 int TestInfoBarManager::GetActiveEntryID() { | 209 int TestInfoBarManager::GetActiveEntryID() { |
| 200 return unique_id_; | 210 return unique_id_; |
| 201 } | 211 } |
| 202 | 212 |
| 213 const infobars::InfoBarConstants& TestInfoBarManager::GetInfoBarConstants() |
| 214 const { |
| 215 return kTestInfoBarConstants; |
| 216 } |
| 217 |
| 203 } // namespace | 218 } // namespace |
| 204 | 219 |
| 205 // GoogleURLTrackerTest ------------------------------------------------------- | 220 // GoogleURLTrackerTest ------------------------------------------------------- |
| 206 | 221 |
| 207 class GoogleURLTrackerTest : public testing::Test { | 222 class GoogleURLTrackerTest : public testing::Test { |
| 208 protected: | 223 protected: |
| 209 GoogleURLTrackerTest(); | 224 GoogleURLTrackerTest(); |
| 210 ~GoogleURLTrackerTest() override; | 225 ~GoogleURLTrackerTest() override; |
| 211 | 226 |
| 212 // testing::Test | 227 // testing::Test |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 EXPECT_FALSE(GetInfoBarDelegate(&infobar_manager) == NULL); | 1059 EXPECT_FALSE(GetInfoBarDelegate(&infobar_manager) == NULL); |
| 1045 GoogleURLTrackerInfoBarDelegate* delegate2 = | 1060 GoogleURLTrackerInfoBarDelegate* delegate2 = |
| 1046 GetInfoBarDelegate(&infobar_manager2); | 1061 GetInfoBarDelegate(&infobar_manager2); |
| 1047 ASSERT_FALSE(delegate2 == NULL); | 1062 ASSERT_FALSE(delegate2 == NULL); |
| 1048 SetNavigationPending(&infobar_manager, true); | 1063 SetNavigationPending(&infobar_manager, true); |
| 1049 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(&infobar_manager, true)); | 1064 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(&infobar_manager, true)); |
| 1050 delegate2->Close(false); | 1065 delegate2->Close(false); |
| 1051 SetNavigationPending(&infobar_manager, false); | 1066 SetNavigationPending(&infobar_manager, false); |
| 1052 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(&infobar_manager, false)); | 1067 ASSERT_NO_FATAL_FAILURE(ExpectListeningForCommit(&infobar_manager, false)); |
| 1053 } | 1068 } |
| OLD | NEW |