OLD | NEW |
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/password_manager/core/browser/affiliation_fetch_throttler.h
" | 5 #include "components/password_manager/core/browser/affiliation_fetch_throttler.h
" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
18 #include "base/numerics/safe_math.h" | 18 #include "base/numerics/safe_math.h" |
19 #include "base/run_loop.h" | 19 #include "base/run_loop.h" |
20 #include "base/test/test_mock_time_task_runner.h" | 20 #include "base/test/test_mock_time_task_runner.h" |
21 #include "base/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
22 #include "base/time/tick_clock.h" | 22 #include "base/time/tick_clock.h" |
23 #include "base/time/time.h" | 23 #include "base/time/time.h" |
24 #include "components/password_manager/core/browser/affiliation_fetch_throttler_d
elegate.h" | 24 #include "components/password_manager/core/browser/affiliation_fetch_throttler_d
elegate.h" |
25 #include "net/base/network_change_notifier.h" | 25 #include "net/base/network_change_notifier.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
27 | 27 |
28 namespace password_manager { | 28 namespace password_manager { |
29 namespace { | 29 namespace { |
30 | 30 |
31 class MockAffiliationFetchThrottlerDelegate | 31 class MockAffiliationFetchThrottlerDelegate |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 ASSERT_NO_FATAL_FAILURE(AssertReleaseInBetween(true, 0, 0)); | 415 ASSERT_NO_FATAL_FAILURE(AssertReleaseInBetween(true, 0, 0)); |
416 throttler->InformOfNetworkRequestComplete(false); | 416 throttler->InformOfNetworkRequestComplete(false); |
417 | 417 |
418 throttler->SignalNetworkRequestNeeded(); | 418 throttler->SignalNetworkRequestNeeded(); |
419 throttler.reset(); | 419 throttler.reset(); |
420 EXPECT_EQ(1u, GetPendingTaskCount()); | 420 EXPECT_EQ(1u, GetPendingTaskCount()); |
421 AssertNoReleaseUntilNoTasksRemain(); | 421 AssertNoReleaseUntilNoTasksRemain(); |
422 } | 422 } |
423 | 423 |
424 } // namespace password_manager | 424 } // namespace password_manager |
OLD | NEW |