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/files/file_util.h" | 5 #include "base/files/file_util.h" |
6 #include "base/location.h" | 6 #include "base/location.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 base::MessageLoop::current()->Run(); | 74 base::MessageLoop::current()->Run(); |
75 } else { | 75 } else { |
76 DCHECK(!start_); | 76 DCHECK(!start_); |
77 already_quit_ = false; | 77 already_quit_ = false; |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 void Notify() { | 81 void Notify() { |
82 if (start_) { | 82 if (start_) { |
83 DCHECK(!already_quit_); | 83 DCHECK(!already_quit_); |
84 base::MessageLoop::current()->Quit(); | 84 base::MessageLoop::current()->QuitWhenIdle(); |
85 start_ = false; | 85 start_ = false; |
86 } else { | 86 } else { |
87 DCHECK(!already_quit_); | 87 DCHECK(!already_quit_); |
88 already_quit_ = true; | 88 already_quit_ = true; |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 private: | 92 private: |
93 // Helps prevent from running message_loop, if the callback invoked | 93 // Helps prevent from running message_loop, if the callback invoked |
94 // immediately. | 94 // immediately. |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 &run_loop)); | 914 &run_loop)); |
915 run_loop.Run(); | 915 run_loop.Run(); |
916 | 916 |
917 // kOrigin1 and kOrigin2 do not have age more than a week. | 917 // kOrigin1 and kOrigin2 do not have age more than a week. |
918 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin1)); | 918 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin1)); |
919 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin2)); | 919 EXPECT_FALSE(tester.DOMStorageExistsForOrigin(kOrigin2)); |
920 EXPECT_TRUE(tester.DOMStorageExistsForOrigin(kOrigin3)); | 920 EXPECT_TRUE(tester.DOMStorageExistsForOrigin(kOrigin3)); |
921 } | 921 } |
922 | 922 |
923 } // namespace content | 923 } // namespace content |
OLD | NEW |