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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 class AwaitCompletionHelper { | 94 class AwaitCompletionHelper { |
95 public: | 95 public: |
96 AwaitCompletionHelper() : start_(false), already_quit_(false) {} | 96 AwaitCompletionHelper() : start_(false), already_quit_(false) {} |
97 virtual ~AwaitCompletionHelper() {} | 97 virtual ~AwaitCompletionHelper() {} |
98 | 98 |
99 void BlockUntilNotified() { | 99 void BlockUntilNotified() { |
100 if (!already_quit_) { | 100 if (!already_quit_) { |
101 DCHECK(!start_); | 101 DCHECK(!start_); |
102 start_ = true; | 102 start_ = true; |
103 base::MessageLoop::current()->Run(); | 103 base::RunLoop().Run(); |
104 } else { | 104 } else { |
105 DCHECK(!start_); | 105 DCHECK(!start_); |
106 already_quit_ = false; | 106 already_quit_ = false; |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 void Notify() { | 110 void Notify() { |
111 if (start_) { | 111 if (start_) { |
112 DCHECK(!already_quit_); | 112 DCHECK(!already_quit_); |
113 base::MessageLoop::current()->QuitWhenIdle(); | 113 base::MessageLoop::current()->QuitWhenIdle(); |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 CanonicalCookie::Create(url2, "A=B;domain=.example.com", now, options)); | 1313 CanonicalCookie::Create(url2, "A=B;domain=.example.com", now, options)); |
1314 invalid_cookies.push_back(CanonicalCookie::Create(url3, "A=B", now, options)); | 1314 invalid_cookies.push_back(CanonicalCookie::Create(url3, "A=B", now, options)); |
1315 | 1315 |
1316 for (const auto& cookie : valid_cookies) | 1316 for (const auto& cookie : valid_cookies) |
1317 EXPECT_TRUE(predicate.Run(*cookie)) << cookie->DebugString(); | 1317 EXPECT_TRUE(predicate.Run(*cookie)) << cookie->DebugString(); |
1318 for (const auto& cookie : invalid_cookies) | 1318 for (const auto& cookie : invalid_cookies) |
1319 EXPECT_FALSE(predicate.Run(*cookie)) << cookie->DebugString(); | 1319 EXPECT_FALSE(predicate.Run(*cookie)) << cookie->DebugString(); |
1320 } | 1320 } |
1321 | 1321 |
1322 } // namespace content | 1322 } // namespace content |
OLD | NEW |