OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // Disable everything on windows only. http://crbug.com/306144 | 5 // Disable everything on windows only. http://crbug.com/306144 |
6 #ifndef OS_WIN | 6 #ifndef OS_WIN |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 NOTREACHED(); | 201 NOTREACHED(); |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 bool WaitFor(Profile* profile, | 205 bool WaitFor(Profile* profile, |
206 const std::string& event_name, | 206 const std::string& event_name, |
207 const std::string& json_args) { | 207 const std::string& json_args) { |
208 waiting_for_.reset(new Event(profile, event_name, json_args, base::Time())); | 208 waiting_for_.reset(new Event(profile, event_name, json_args, base::Time())); |
209 for (std::deque<Event*>::const_iterator iter = events_.begin(); | 209 for (std::deque<Event*>::const_iterator iter = events_.begin(); |
210 iter != events_.end(); ++iter) { | 210 iter != events_.end(); ++iter) { |
211 if ((*iter)->Satisfies(*waiting_for_.get())) { | 211 if ((*iter)->Satisfies(*waiting_for_)) { |
212 return true; | 212 return true; |
213 } | 213 } |
214 } | 214 } |
215 waiting_ = true; | 215 waiting_ = true; |
216 content::RunMessageLoop(); | 216 content::RunMessageLoop(); |
217 bool success = !waiting_; | 217 bool success = !waiting_; |
218 if (waiting_) { | 218 if (waiting_) { |
219 // Print the events that were caught since the last WaitFor() call to help | 219 // Print the events that were caught since the last WaitFor() call to help |
220 // find the erroneous event. | 220 // find the erroneous event. |
221 // TODO(benjhayden) Fuzzy-match and highlight the erroneous event. | 221 // TODO(benjhayden) Fuzzy-match and highlight the erroneous event. |
(...skipping 4059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4281 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); | 4281 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); |
4282 EXPECT_FALSE(warnings.empty()); | 4282 EXPECT_FALSE(warnings.empty()); |
4283 EXPECT_EQ(Warning::kDownloadFilenameConflict, | 4283 EXPECT_EQ(Warning::kDownloadFilenameConflict, |
4284 warnings.begin()->warning_type()); | 4284 warnings.begin()->warning_type()); |
4285 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); | 4285 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); |
4286 } | 4286 } |
4287 | 4287 |
4288 } // namespace extensions | 4288 } // namespace extensions |
4289 | 4289 |
4290 #endif // http://crbug.com/306144 | 4290 #endif // http://crbug.com/306144 |
OLD | NEW |