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(); | |
274 | 268 |
275 // Verify that the downloader is attempting to download a CRX file. | 269 // Verify that the downloader is attempting to download a CRX file. |
276 fetcher = factory.GetFetcherByID( | 270 fetcher = factory.GetFetcherByID( |
277 extensions::ExtensionDownloader::kExtensionFetcherId); | 271 extensions::ExtensionDownloader::kExtensionFetcherId); |
278 ASSERT_TRUE(fetcher); | 272 ASSERT_TRUE(fetcher); |
279 ASSERT_TRUE(fetcher->delegate()); | 273 ASSERT_TRUE(fetcher->delegate()); |
280 | 274 |
281 // Create a temporary CRX file and return its path to the downloader. | 275 // Create a temporary CRX file and return its path to the downloader. |
282 EXPECT_TRUE(base::CopyFile( | 276 EXPECT_TRUE(base::CopyFile( |
283 test_dir_.Append(kExtensionCRXSourceDir).Append(kExtensionCRXFile), | 277 test_dir_.Append(kExtensionCRXSourceDir).Append(kExtensionCRXFile), |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 loader_->StopCache(shutdown_run_loop.QuitClosure()); | 312 loader_->StopCache(shutdown_run_loop.QuitClosure()); |
319 VerifyAndResetVisitorCallExpectations(); | 313 VerifyAndResetVisitorCallExpectations(); |
320 | 314 |
321 // Spin the loop until the cache shutdown callback is invoked. Verify that at | 315 // Spin the loop until the cache shutdown callback is invoked. Verify that at |
322 // that point, no further file I/O tasks are pending. | 316 // that point, no further file I/O tasks are pending. |
323 shutdown_run_loop.Run(); | 317 shutdown_run_loop.Run(); |
324 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); | 318 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); |
325 } | 319 } |
326 | 320 |
327 } // namespace chromeos | 321 } // namespace chromeos |
OLD | NEW |