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 "chrome/browser/chromeos/extensions/device_local_account_external_polic
y_loader.h" | 5 #include "chrome/browser/chromeos/extensions/device_local_account_external_polic
y_loader.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 EXPECT_TRUE(base::ReadFileToString(test_dir_.Append(kExtensionUpdateManifest), | 258 EXPECT_TRUE(base::ReadFileToString(test_dir_.Append(kExtensionUpdateManifest), |
259 &manifest)); | 259 &manifest)); |
260 fetcher->set_response_code(200); | 260 fetcher->set_response_code(200); |
261 fetcher->SetResponseString(manifest); | 261 fetcher->SetResponseString(manifest); |
262 fetcher->delegate()->OnURLFetchComplete(fetcher); | 262 fetcher->delegate()->OnURLFetchComplete(fetcher); |
263 | 263 |
264 // Wait for the manifest to be parsed. | 264 // Wait for the manifest to be parsed. |
265 content::WindowedNotificationObserver( | 265 content::WindowedNotificationObserver( |
266 extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, | 266 extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, |
267 content::NotificationService::AllSources()).Wait(); | 267 content::NotificationService::AllSources()).Wait(); |
| 268 // Temporary solution to mimic the old behavior of |
| 269 // WindowedNotificationObserver. |
| 270 // TODO(https://crbug.com/695073): Likely this has to be removed, and the |
| 271 // IsIdleForTesting check at the end of this test has to be either changed to |
| 272 // a more specific check or removed. |
| 273 content::RunAllPendingInMessageLoop(); |
268 | 274 |
269 // Verify that the downloader is attempting to download a CRX file. | 275 // Verify that the downloader is attempting to download a CRX file. |
270 fetcher = factory.GetFetcherByID( | 276 fetcher = factory.GetFetcherByID( |
271 extensions::ExtensionDownloader::kExtensionFetcherId); | 277 extensions::ExtensionDownloader::kExtensionFetcherId); |
272 ASSERT_TRUE(fetcher); | 278 ASSERT_TRUE(fetcher); |
273 ASSERT_TRUE(fetcher->delegate()); | 279 ASSERT_TRUE(fetcher->delegate()); |
274 | 280 |
275 // Create a temporary CRX file and return its path to the downloader. | 281 // Create a temporary CRX file and return its path to the downloader. |
276 EXPECT_TRUE(base::CopyFile( | 282 EXPECT_TRUE(base::CopyFile( |
277 test_dir_.Append(kExtensionCRXSourceDir).Append(kExtensionCRXFile), | 283 test_dir_.Append(kExtensionCRXSourceDir).Append(kExtensionCRXFile), |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 loader_->StopCache(shutdown_run_loop.QuitClosure()); | 318 loader_->StopCache(shutdown_run_loop.QuitClosure()); |
313 VerifyAndResetVisitorCallExpectations(); | 319 VerifyAndResetVisitorCallExpectations(); |
314 | 320 |
315 // Spin the loop until the cache shutdown callback is invoked. Verify that at | 321 // Spin the loop until the cache shutdown callback is invoked. Verify that at |
316 // that point, no further file I/O tasks are pending. | 322 // that point, no further file I/O tasks are pending. |
317 shutdown_run_loop.Run(); | 323 shutdown_run_loop.Run(); |
318 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); | 324 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); |
319 } | 325 } |
320 | 326 |
321 } // namespace chromeos | 327 } // namespace chromeos |
OLD | NEW |