OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 public: | 223 public: |
224 static void Callback(const base::Closure& quit_closure, Error error) { | 224 static void Callback(const base::Closure& quit_closure, Error error) { |
225 EXPECT_EQ(Error::NONE, error); | 225 EXPECT_EQ(Error::NONE, error); |
226 quit_closure.Run(); | 226 quit_closure.Run(); |
227 } | 227 } |
228 }; | 228 }; |
229 | 229 |
230 class FakeUpdateChecker : public UpdateChecker { | 230 class FakeUpdateChecker : public UpdateChecker { |
231 public: | 231 public: |
232 static std::unique_ptr<UpdateChecker> Create( | 232 static std::unique_ptr<UpdateChecker> Create( |
233 const scoped_refptr<Configurator>& config, | 233 const scoped_refptr<Configurator>& config) { |
234 PersistedData* metadata) { | |
235 return base::MakeUnique<FakeUpdateChecker>(); | 234 return base::MakeUnique<FakeUpdateChecker>(); |
236 } | 235 } |
237 | 236 |
238 bool CheckForUpdates( | 237 bool CheckForUpdates( |
239 const std::vector<std::string>& ids_to_check, | 238 const std::vector<std::string>& ids_to_check, |
240 const IdToComponentPtrMap& components, | 239 const IdToComponentPtrMap& components, |
241 const std::string& additional_attributes, | 240 const std::string& additional_attributes, |
242 bool enabled_component_updates, | 241 bool enabled_component_updates, |
243 const UpdateCheckCallback& update_check_callback) override { | 242 const UpdateCheckCallback& update_check_callback) override { |
244 EXPECT_TRUE(enabled_component_updates); | 243 EXPECT_TRUE(enabled_component_updates); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 public: | 337 public: |
339 static void Callback(const base::Closure& quit_closure, Error error) { | 338 static void Callback(const base::Closure& quit_closure, Error error) { |
340 EXPECT_EQ(Error::NONE, error); | 339 EXPECT_EQ(Error::NONE, error); |
341 quit_closure.Run(); | 340 quit_closure.Run(); |
342 } | 341 } |
343 }; | 342 }; |
344 | 343 |
345 class FakeUpdateChecker : public UpdateChecker { | 344 class FakeUpdateChecker : public UpdateChecker { |
346 public: | 345 public: |
347 static std::unique_ptr<UpdateChecker> Create( | 346 static std::unique_ptr<UpdateChecker> Create( |
348 const scoped_refptr<Configurator>& config, | 347 const scoped_refptr<Configurator>& config) { |
349 PersistedData* metadata) { | |
350 return base::MakeUnique<FakeUpdateChecker>(); | 348 return base::MakeUnique<FakeUpdateChecker>(); |
351 } | 349 } |
352 | 350 |
353 bool CheckForUpdates( | 351 bool CheckForUpdates( |
354 const std::vector<std::string>& ids_to_check, | 352 const std::vector<std::string>& ids_to_check, |
355 const IdToComponentPtrMap& components, | 353 const IdToComponentPtrMap& components, |
356 const std::string& additional_attributes, | 354 const std::string& additional_attributes, |
357 bool enabled_component_updates, | 355 bool enabled_component_updates, |
358 const UpdateCheckCallback& update_check_callback) override { | 356 const UpdateCheckCallback& update_check_callback) override { |
359 /* | 357 /* |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 public: | 550 public: |
553 static void Callback(const base::Closure& quit_closure, Error error) { | 551 static void Callback(const base::Closure& quit_closure, Error error) { |
554 EXPECT_EQ(Error::NONE, error); | 552 EXPECT_EQ(Error::NONE, error); |
555 quit_closure.Run(); | 553 quit_closure.Run(); |
556 } | 554 } |
557 }; | 555 }; |
558 | 556 |
559 class FakeUpdateChecker : public UpdateChecker { | 557 class FakeUpdateChecker : public UpdateChecker { |
560 public: | 558 public: |
561 static std::unique_ptr<UpdateChecker> Create( | 559 static std::unique_ptr<UpdateChecker> Create( |
562 const scoped_refptr<Configurator>& config, | 560 const scoped_refptr<Configurator>& config) { |
563 PersistedData* metadata) { | |
564 return base::MakeUnique<FakeUpdateChecker>(); | 561 return base::MakeUnique<FakeUpdateChecker>(); |
565 } | 562 } |
566 | 563 |
567 bool CheckForUpdates( | 564 bool CheckForUpdates( |
568 const std::vector<std::string>& ids_to_check, | 565 const std::vector<std::string>& ids_to_check, |
569 const IdToComponentPtrMap& components, | 566 const IdToComponentPtrMap& components, |
570 const std::string& additional_attributes, | 567 const std::string& additional_attributes, |
571 bool enabled_component_updates, | 568 bool enabled_component_updates, |
572 const UpdateCheckCallback& update_check_callback) override { | 569 const UpdateCheckCallback& update_check_callback) override { |
573 /* | 570 /* |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 public: | 821 public: |
825 static void Callback(const base::Closure& quit_closure, Error error) { | 822 static void Callback(const base::Closure& quit_closure, Error error) { |
826 EXPECT_EQ(Error::NONE, error); | 823 EXPECT_EQ(Error::NONE, error); |
827 quit_closure.Run(); | 824 quit_closure.Run(); |
828 } | 825 } |
829 }; | 826 }; |
830 | 827 |
831 class FakeUpdateChecker : public UpdateChecker { | 828 class FakeUpdateChecker : public UpdateChecker { |
832 public: | 829 public: |
833 static std::unique_ptr<UpdateChecker> Create( | 830 static std::unique_ptr<UpdateChecker> Create( |
834 const scoped_refptr<Configurator>& config, | 831 const scoped_refptr<Configurator>& config) { |
835 PersistedData* metadata) { | |
836 return base::MakeUnique<FakeUpdateChecker>(); | 832 return base::MakeUnique<FakeUpdateChecker>(); |
837 } | 833 } |
838 | 834 |
839 bool CheckForUpdates( | 835 bool CheckForUpdates( |
840 const std::vector<std::string>& ids_to_check, | 836 const std::vector<std::string>& ids_to_check, |
841 const IdToComponentPtrMap& components, | 837 const IdToComponentPtrMap& components, |
842 const std::string& additional_attributes, | 838 const std::string& additional_attributes, |
843 bool enabled_component_updates, | 839 bool enabled_component_updates, |
844 const UpdateCheckCallback& update_check_callback) override { | 840 const UpdateCheckCallback& update_check_callback) override { |
845 /* | 841 /* |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 public: | 1093 public: |
1098 static void Callback(const base::Closure& quit_closure, Error error) { | 1094 static void Callback(const base::Closure& quit_closure, Error error) { |
1099 EXPECT_EQ(Error::NONE, error); | 1095 EXPECT_EQ(Error::NONE, error); |
1100 quit_closure.Run(); | 1096 quit_closure.Run(); |
1101 } | 1097 } |
1102 }; | 1098 }; |
1103 | 1099 |
1104 class FakeUpdateChecker : public UpdateChecker { | 1100 class FakeUpdateChecker : public UpdateChecker { |
1105 public: | 1101 public: |
1106 static std::unique_ptr<UpdateChecker> Create( | 1102 static std::unique_ptr<UpdateChecker> Create( |
1107 const scoped_refptr<Configurator>& config, | 1103 const scoped_refptr<Configurator>& config) { |
1108 PersistedData* metadata) { | |
1109 return base::MakeUnique<FakeUpdateChecker>(); | 1104 return base::MakeUnique<FakeUpdateChecker>(); |
1110 } | 1105 } |
1111 | 1106 |
1112 bool CheckForUpdates( | 1107 bool CheckForUpdates( |
1113 const std::vector<std::string>& ids_to_check, | 1108 const std::vector<std::string>& ids_to_check, |
1114 const IdToComponentPtrMap& components, | 1109 const IdToComponentPtrMap& components, |
1115 const std::string& additional_attributes, | 1110 const std::string& additional_attributes, |
1116 bool enabled_component_updates, | 1111 bool enabled_component_updates, |
1117 const UpdateCheckCallback& update_check_callback) override { | 1112 const UpdateCheckCallback& update_check_callback) override { |
1118 static int num_call = 0; | 1113 static int num_call = 0; |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 public: | 1405 public: |
1411 static void Callback(const base::Closure& quit_closure, Error error) { | 1406 static void Callback(const base::Closure& quit_closure, Error error) { |
1412 EXPECT_EQ(Error::NONE, error); | 1407 EXPECT_EQ(Error::NONE, error); |
1413 quit_closure.Run(); | 1408 quit_closure.Run(); |
1414 } | 1409 } |
1415 }; | 1410 }; |
1416 | 1411 |
1417 class FakeUpdateChecker : public UpdateChecker { | 1412 class FakeUpdateChecker : public UpdateChecker { |
1418 public: | 1413 public: |
1419 static std::unique_ptr<UpdateChecker> Create( | 1414 static std::unique_ptr<UpdateChecker> Create( |
1420 const scoped_refptr<Configurator>& config, | 1415 const scoped_refptr<Configurator>& config) { |
1421 PersistedData* metadata) { | |
1422 return base::MakeUnique<FakeUpdateChecker>(); | 1416 return base::MakeUnique<FakeUpdateChecker>(); |
1423 } | 1417 } |
1424 | 1418 |
1425 bool CheckForUpdates( | 1419 bool CheckForUpdates( |
1426 const std::vector<std::string>& ids_to_check, | 1420 const std::vector<std::string>& ids_to_check, |
1427 const IdToComponentPtrMap& components, | 1421 const IdToComponentPtrMap& components, |
1428 const std::string& additional_attributes, | 1422 const std::string& additional_attributes, |
1429 bool enabled_component_updates, | 1423 bool enabled_component_updates, |
1430 const UpdateCheckCallback& update_check_callback) override { | 1424 const UpdateCheckCallback& update_check_callback) override { |
1431 /* | 1425 /* |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1600 public: | 1594 public: |
1601 static void Callback(const base::Closure& quit_closure, Error error) { | 1595 static void Callback(const base::Closure& quit_closure, Error error) { |
1602 EXPECT_EQ(Error::NONE, error); | 1596 EXPECT_EQ(Error::NONE, error); |
1603 quit_closure.Run(); | 1597 quit_closure.Run(); |
1604 } | 1598 } |
1605 }; | 1599 }; |
1606 | 1600 |
1607 class FakeUpdateChecker : public UpdateChecker { | 1601 class FakeUpdateChecker : public UpdateChecker { |
1608 public: | 1602 public: |
1609 static std::unique_ptr<UpdateChecker> Create( | 1603 static std::unique_ptr<UpdateChecker> Create( |
1610 const scoped_refptr<Configurator>& config, | 1604 const scoped_refptr<Configurator>& config) { |
1611 PersistedData* metadata) { | |
1612 return base::MakeUnique<FakeUpdateChecker>(); | 1605 return base::MakeUnique<FakeUpdateChecker>(); |
1613 } | 1606 } |
1614 | 1607 |
1615 bool CheckForUpdates( | 1608 bool CheckForUpdates( |
1616 const std::vector<std::string>& ids_to_check, | 1609 const std::vector<std::string>& ids_to_check, |
1617 const IdToComponentPtrMap& components, | 1610 const IdToComponentPtrMap& components, |
1618 const std::string& additional_attributes, | 1611 const std::string& additional_attributes, |
1619 bool enabled_component_updates, | 1612 bool enabled_component_updates, |
1620 const UpdateCheckCallback& update_check_callback) override { | 1613 const UpdateCheckCallback& update_check_callback) override { |
1621 static int num_call = 0; | 1614 static int num_call = 0; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1908 EXPECT_EQ(Error::NONE, error); | 1901 EXPECT_EQ(Error::NONE, error); |
1909 | 1902 |
1910 if (num_call == 2) | 1903 if (num_call == 2) |
1911 quit_closure.Run(); | 1904 quit_closure.Run(); |
1912 } | 1905 } |
1913 }; | 1906 }; |
1914 | 1907 |
1915 class FakeUpdateChecker : public UpdateChecker { | 1908 class FakeUpdateChecker : public UpdateChecker { |
1916 public: | 1909 public: |
1917 static std::unique_ptr<UpdateChecker> Create( | 1910 static std::unique_ptr<UpdateChecker> Create( |
1918 const scoped_refptr<Configurator>& config, | 1911 const scoped_refptr<Configurator>& config) { |
1919 PersistedData* metadata) { | |
1920 return base::MakeUnique<FakeUpdateChecker>(); | 1912 return base::MakeUnique<FakeUpdateChecker>(); |
1921 } | 1913 } |
1922 | 1914 |
1923 bool CheckForUpdates( | 1915 bool CheckForUpdates( |
1924 const std::vector<std::string>& ids_to_check, | 1916 const std::vector<std::string>& ids_to_check, |
1925 const IdToComponentPtrMap& components, | 1917 const IdToComponentPtrMap& components, |
1926 const std::string& additional_attributes, | 1918 const std::string& additional_attributes, |
1927 bool enabled_component_updates, | 1919 bool enabled_component_updates, |
1928 const UpdateCheckCallback& update_check_callback) override { | 1920 const UpdateCheckCallback& update_check_callback) override { |
1929 EXPECT_TRUE(enabled_component_updates); | 1921 EXPECT_TRUE(enabled_component_updates); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 public: | 2015 public: |
2024 static void Callback(const base::Closure& quit_closure, Error error) { | 2016 static void Callback(const base::Closure& quit_closure, Error error) { |
2025 EXPECT_EQ(Error::NONE, error); | 2017 EXPECT_EQ(Error::NONE, error); |
2026 quit_closure.Run(); | 2018 quit_closure.Run(); |
2027 } | 2019 } |
2028 }; | 2020 }; |
2029 | 2021 |
2030 class FakeUpdateChecker : public UpdateChecker { | 2022 class FakeUpdateChecker : public UpdateChecker { |
2031 public: | 2023 public: |
2032 static std::unique_ptr<UpdateChecker> Create( | 2024 static std::unique_ptr<UpdateChecker> Create( |
2033 const scoped_refptr<Configurator>& config, | 2025 const scoped_refptr<Configurator>& config) { |
2034 PersistedData* metadata) { | |
2035 return base::MakeUnique<FakeUpdateChecker>(); | 2026 return base::MakeUnique<FakeUpdateChecker>(); |
2036 } | 2027 } |
2037 | 2028 |
2038 bool CheckForUpdates( | 2029 bool CheckForUpdates( |
2039 const std::vector<std::string>& ids_to_check, | 2030 const std::vector<std::string>& ids_to_check, |
2040 const IdToComponentPtrMap& components, | 2031 const IdToComponentPtrMap& components, |
2041 const std::string& additional_attributes, | 2032 const std::string& additional_attributes, |
2042 bool enabled_component_updates, | 2033 bool enabled_component_updates, |
2043 const UpdateCheckCallback& update_check_callback) override { | 2034 const UpdateCheckCallback& update_check_callback) override { |
2044 /* | 2035 /* |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2218 if (num_call == 2) { | 2209 if (num_call == 2) { |
2219 EXPECT_EQ(Error::NONE, error); | 2210 EXPECT_EQ(Error::NONE, error); |
2220 quit_closure.Run(); | 2211 quit_closure.Run(); |
2221 } | 2212 } |
2222 } | 2213 } |
2223 }; | 2214 }; |
2224 | 2215 |
2225 class FakeUpdateChecker : public UpdateChecker { | 2216 class FakeUpdateChecker : public UpdateChecker { |
2226 public: | 2217 public: |
2227 static std::unique_ptr<UpdateChecker> Create( | 2218 static std::unique_ptr<UpdateChecker> Create( |
2228 const scoped_refptr<Configurator>& config, | 2219 const scoped_refptr<Configurator>& config) { |
2229 PersistedData* metadata) { | |
2230 return base::MakeUnique<FakeUpdateChecker>(); | 2220 return base::MakeUnique<FakeUpdateChecker>(); |
2231 } | 2221 } |
2232 | 2222 |
2233 bool CheckForUpdates( | 2223 bool CheckForUpdates( |
2234 const std::vector<std::string>& ids_to_check, | 2224 const std::vector<std::string>& ids_to_check, |
2235 const IdToComponentPtrMap& components, | 2225 const IdToComponentPtrMap& components, |
2236 const std::string& additional_attributes, | 2226 const std::string& additional_attributes, |
2237 bool enabled_component_updates, | 2227 bool enabled_component_updates, |
2238 const UpdateCheckCallback& update_check_callback) override { | 2228 const UpdateCheckCallback& update_check_callback) override { |
2239 EXPECT_TRUE(enabled_component_updates); | 2229 EXPECT_TRUE(enabled_component_updates); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2326 public: | 2316 public: |
2327 static void Callback(const base::Closure& quit_closure, Error error) { | 2317 static void Callback(const base::Closure& quit_closure, Error error) { |
2328 DCHECK_EQ(Error::INVALID_ARGUMENT, error); | 2318 DCHECK_EQ(Error::INVALID_ARGUMENT, error); |
2329 quit_closure.Run(); | 2319 quit_closure.Run(); |
2330 } | 2320 } |
2331 }; | 2321 }; |
2332 | 2322 |
2333 class FakeUpdateChecker : public UpdateChecker { | 2323 class FakeUpdateChecker : public UpdateChecker { |
2334 public: | 2324 public: |
2335 static std::unique_ptr<UpdateChecker> Create( | 2325 static std::unique_ptr<UpdateChecker> Create( |
2336 const scoped_refptr<Configurator>& config, | 2326 const scoped_refptr<Configurator>& config) { |
2337 PersistedData* metadata) { | |
2338 return base::MakeUnique<FakeUpdateChecker>(); | 2327 return base::MakeUnique<FakeUpdateChecker>(); |
2339 } | 2328 } |
2340 | 2329 |
2341 bool CheckForUpdates( | 2330 bool CheckForUpdates( |
2342 const std::vector<std::string>& ids_to_check, | 2331 const std::vector<std::string>& ids_to_check, |
2343 const IdToComponentPtrMap& components, | 2332 const IdToComponentPtrMap& components, |
2344 const std::string& additional_attributes, | 2333 const std::string& additional_attributes, |
2345 bool enabled_component_updates, | 2334 bool enabled_component_updates, |
2346 const UpdateCheckCallback& update_check_callback) override { | 2335 const UpdateCheckCallback& update_check_callback) override { |
2347 return false; | 2336 return false; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2380 class CompletionCallbackFake { | 2369 class CompletionCallbackFake { |
2381 public: | 2370 public: |
2382 static void Callback(const base::Closure& quit_closure, Error error) { | 2371 static void Callback(const base::Closure& quit_closure, Error error) { |
2383 quit_closure.Run(); | 2372 quit_closure.Run(); |
2384 } | 2373 } |
2385 }; | 2374 }; |
2386 | 2375 |
2387 class FakeUpdateChecker : public UpdateChecker { | 2376 class FakeUpdateChecker : public UpdateChecker { |
2388 public: | 2377 public: |
2389 static std::unique_ptr<UpdateChecker> Create( | 2378 static std::unique_ptr<UpdateChecker> Create( |
2390 const scoped_refptr<Configurator>& config, | 2379 const scoped_refptr<Configurator>& config) { |
2391 PersistedData* metadata) { | |
2392 return nullptr; | 2380 return nullptr; |
2393 } | 2381 } |
2394 | 2382 |
2395 bool CheckForUpdates( | 2383 bool CheckForUpdates( |
2396 const std::vector<std::string>& ids_to_check, | 2384 const std::vector<std::string>& ids_to_check, |
2397 const IdToComponentPtrMap& components, | 2385 const IdToComponentPtrMap& components, |
2398 const std::string& additional_attributes, | 2386 const std::string& additional_attributes, |
2399 bool enabled_component_updates, | 2387 bool enabled_component_updates, |
2400 const UpdateCheckCallback& update_check_callback) override { | 2388 const UpdateCheckCallback& update_check_callback) override { |
2401 return false; | 2389 return false; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2483 EXPECT_EQ(Error::NONE, error); | 2471 EXPECT_EQ(Error::NONE, error); |
2484 } | 2472 } |
2485 | 2473 |
2486 quit_closure.Run(); | 2474 quit_closure.Run(); |
2487 } | 2475 } |
2488 }; | 2476 }; |
2489 | 2477 |
2490 class FakeUpdateChecker : public UpdateChecker { | 2478 class FakeUpdateChecker : public UpdateChecker { |
2491 public: | 2479 public: |
2492 static std::unique_ptr<UpdateChecker> Create( | 2480 static std::unique_ptr<UpdateChecker> Create( |
2493 const scoped_refptr<Configurator>& config, | 2481 const scoped_refptr<Configurator>& config) { |
2494 PersistedData* metadata) { | |
2495 return base::MakeUnique<FakeUpdateChecker>(); | 2482 return base::MakeUnique<FakeUpdateChecker>(); |
2496 } | 2483 } |
2497 | 2484 |
2498 bool CheckForUpdates( | 2485 bool CheckForUpdates( |
2499 const std::vector<std::string>& ids_to_check, | 2486 const std::vector<std::string>& ids_to_check, |
2500 const IdToComponentPtrMap& components, | 2487 const IdToComponentPtrMap& components, |
2501 const std::string& additional_attributes, | 2488 const std::string& additional_attributes, |
2502 bool enabled_component_updates, | 2489 bool enabled_component_updates, |
2503 const UpdateCheckCallback& update_check_callback) override { | 2490 const UpdateCheckCallback& update_check_callback) override { |
2504 static int num_call = 0; | 2491 static int num_call = 0; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2659 public: | 2646 public: |
2660 static void Callback(const base::Closure& quit_closure, Error error) { | 2647 static void Callback(const base::Closure& quit_closure, Error error) { |
2661 EXPECT_EQ(Error::NONE, error); | 2648 EXPECT_EQ(Error::NONE, error); |
2662 quit_closure.Run(); | 2649 quit_closure.Run(); |
2663 } | 2650 } |
2664 }; | 2651 }; |
2665 | 2652 |
2666 class FakeUpdateChecker : public UpdateChecker { | 2653 class FakeUpdateChecker : public UpdateChecker { |
2667 public: | 2654 public: |
2668 static std::unique_ptr<UpdateChecker> Create( | 2655 static std::unique_ptr<UpdateChecker> Create( |
2669 const scoped_refptr<Configurator>& config, | 2656 const scoped_refptr<Configurator>& config) { |
2670 PersistedData* metadata) { | |
2671 return base::MakeUnique<FakeUpdateChecker>(); | 2657 return base::MakeUnique<FakeUpdateChecker>(); |
2672 } | 2658 } |
2673 | 2659 |
2674 bool CheckForUpdates( | 2660 bool CheckForUpdates( |
2675 const std::vector<std::string>& ids_to_check, | 2661 const std::vector<std::string>& ids_to_check, |
2676 const IdToComponentPtrMap& components, | 2662 const IdToComponentPtrMap& components, |
2677 const std::string& additional_attributes, | 2663 const std::string& additional_attributes, |
2678 bool enabled_component_updates, | 2664 bool enabled_component_updates, |
2679 const UpdateCheckCallback& update_check_callback) override { | 2665 const UpdateCheckCallback& update_check_callback) override { |
2680 /* | 2666 /* |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2909 public: | 2895 public: |
2910 static void Callback(const base::Closure& quit_closure, Error error) { | 2896 static void Callback(const base::Closure& quit_closure, Error error) { |
2911 EXPECT_EQ(Error::UPDATE_CHECK_ERROR, error); | 2897 EXPECT_EQ(Error::UPDATE_CHECK_ERROR, error); |
2912 quit_closure.Run(); | 2898 quit_closure.Run(); |
2913 } | 2899 } |
2914 }; | 2900 }; |
2915 | 2901 |
2916 class FakeUpdateChecker : public UpdateChecker { | 2902 class FakeUpdateChecker : public UpdateChecker { |
2917 public: | 2903 public: |
2918 static std::unique_ptr<UpdateChecker> Create( | 2904 static std::unique_ptr<UpdateChecker> Create( |
2919 const scoped_refptr<Configurator>& config, | 2905 const scoped_refptr<Configurator>& config) { |
2920 PersistedData* metadata) { | |
2921 return base::MakeUnique<FakeUpdateChecker>(); | 2906 return base::MakeUnique<FakeUpdateChecker>(); |
2922 } | 2907 } |
2923 | 2908 |
2924 bool CheckForUpdates( | 2909 bool CheckForUpdates( |
2925 const std::vector<std::string>& ids_to_check, | 2910 const std::vector<std::string>& ids_to_check, |
2926 const IdToComponentPtrMap& components, | 2911 const IdToComponentPtrMap& components, |
2927 const std::string& additional_attributes, | 2912 const std::string& additional_attributes, |
2928 bool enabled_component_updates, | 2913 bool enabled_component_updates, |
2929 const UpdateCheckCallback& update_check_callback) override { | 2914 const UpdateCheckCallback& update_check_callback) override { |
2930 EXPECT_TRUE(enabled_component_updates); | 2915 EXPECT_TRUE(enabled_component_updates); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2988 update_client->Update( | 2973 update_client->Update( |
2989 ids, base::Bind(&DataCallbackFake::Callback), | 2974 ids, base::Bind(&DataCallbackFake::Callback), |
2990 base::Bind(&CompletionCallbackFake::Callback, quit_closure())); | 2975 base::Bind(&CompletionCallbackFake::Callback, quit_closure())); |
2991 | 2976 |
2992 RunThreads(); | 2977 RunThreads(); |
2993 | 2978 |
2994 update_client->RemoveObserver(&observer); | 2979 update_client->RemoveObserver(&observer); |
2995 } | 2980 } |
2996 | 2981 |
2997 } // namespace update_client | 2982 } // namespace update_client |
OLD | NEW |