| 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 #include <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 content::Source<DownloadsNotificationSource>(source).ptr(); | 180 content::Source<DownloadsNotificationSource>(source).ptr(); |
| 181 Event* new_event = new Event( | 181 Event* new_event = new Event( |
| 182 dns->profile, | 182 dns->profile, |
| 183 dns->event_name, | 183 dns->event_name, |
| 184 *content::Details<std::string>(details).ptr(), base::Time::Now()); | 184 *content::Details<std::string>(details).ptr(), base::Time::Now()); |
| 185 events_.push_back(new_event); | 185 events_.push_back(new_event); |
| 186 if (waiting_ && | 186 if (waiting_ && |
| 187 waiting_for_.get() && | 187 waiting_for_.get() && |
| 188 new_event->Satisfies(*waiting_for_)) { | 188 new_event->Satisfies(*waiting_for_)) { |
| 189 waiting_ = false; | 189 waiting_ = false; |
| 190 MessageLoopForUI::current()->Quit(); | 190 base::MessageLoopForUI::current()->Quit(); |
| 191 } | 191 } |
| 192 break; | 192 break; |
| 193 } | 193 } |
| 194 default: | 194 default: |
| 195 NOTREACHED(); | 195 NOTREACHED(); |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 | 198 |
| 199 bool WaitFor(Profile* profile, | 199 bool WaitFor(Profile* profile, |
| 200 const std::string& event_name, | 200 const std::string& event_name, |
| (...skipping 3278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3479 DownloadsApiTest() {} | 3479 DownloadsApiTest() {} |
| 3480 virtual ~DownloadsApiTest() {} | 3480 virtual ~DownloadsApiTest() {} |
| 3481 private: | 3481 private: |
| 3482 DISALLOW_COPY_AND_ASSIGN(DownloadsApiTest); | 3482 DISALLOW_COPY_AND_ASSIGN(DownloadsApiTest); |
| 3483 }; | 3483 }; |
| 3484 | 3484 |
| 3485 | 3485 |
| 3486 IN_PROC_BROWSER_TEST_F(DownloadsApiTest, DownloadsApiTest) { | 3486 IN_PROC_BROWSER_TEST_F(DownloadsApiTest, DownloadsApiTest) { |
| 3487 ASSERT_TRUE(RunExtensionTest("downloads")) << message_; | 3487 ASSERT_TRUE(RunExtensionTest("downloads")) << message_; |
| 3488 } | 3488 } |
| OLD | NEW |