OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| 11 #include "base/string_number_conversions.h" |
11 #include "base/string_util.h" | 12 #include "base/string_util.h" |
12 #include "base/thread.h" | 13 #include "base/thread.h" |
13 #include "base/version.h" | 14 #include "base/version.h" |
14 #include "chrome/browser/chrome_thread.h" | 15 #include "chrome/browser/chrome_thread.h" |
15 #include "chrome/browser/extensions/extension_error_reporter.h" | 16 #include "chrome/browser/extensions/extension_error_reporter.h" |
16 #include "chrome/browser/extensions/extension_updater.h" | 17 #include "chrome/browser/extensions/extension_updater.h" |
17 #include "chrome/browser/extensions/extensions_service.h" | 18 #include "chrome/browser/extensions/extensions_service.h" |
18 #include "chrome/browser/extensions/test_extension_prefs.h" | 19 #include "chrome/browser/extensions/test_extension_prefs.h" |
19 #include "chrome/browser/pref_service.h" | 20 #include "chrome/browser/pref_service.h" |
20 #include "chrome/common/extensions/extension.h" | 21 #include "chrome/common/extensions/extension.h" |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 NOTREACHED(); | 761 NOTREACHED(); |
761 } | 762 } |
762 | 763 |
763 // Now make sure the non-google query had no ping parameter, but the google | 764 // Now make sure the non-google query had no ping parameter, but the google |
764 // one did (depending on ping_days). | 765 // one did (depending on ping_days). |
765 std::string search_string = "ping%3Dr"; | 766 std::string search_string = "ping%3Dr"; |
766 EXPECT_TRUE(url2_query.find(search_string) == std::string::npos); | 767 EXPECT_TRUE(url2_query.find(search_string) == std::string::npos); |
767 if (ping_days == 0) { | 768 if (ping_days == 0) { |
768 EXPECT_TRUE(url1_query.find(search_string) == std::string::npos); | 769 EXPECT_TRUE(url1_query.find(search_string) == std::string::npos); |
769 } else { | 770 } else { |
770 search_string += "%253D" + IntToString(ping_days); | 771 search_string += "%253D" + base::IntToString(ping_days); |
771 size_t pos = url1_query.find(search_string); | 772 size_t pos = url1_query.find(search_string); |
772 EXPECT_TRUE(pos != std::string::npos); | 773 EXPECT_TRUE(pos != std::string::npos); |
773 } | 774 } |
774 | 775 |
775 STLDeleteElements(&tmp); | 776 STLDeleteElements(&tmp); |
776 } | 777 } |
777 | 778 |
778 // This makes sure that the extension updater properly stores the results | 779 // This makes sure that the extension updater properly stores the results |
779 // of a <daystart> tag from a manifest fetch in one of two cases: 1) This is | 780 // of a <daystart> tag from a manifest fetch in one of two cases: 1) This is |
780 // the first time we fetched the extension, or 2) We sent a ping value of | 781 // the first time we fetched the extension, or 2) We sent a ping value of |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 // -prodversionmin (shouldn't update if browser version too old) | 909 // -prodversionmin (shouldn't update if browser version too old) |
909 // -manifests & updates arriving out of order / interleaved | 910 // -manifests & updates arriving out of order / interleaved |
910 // -Profile::GetDefaultRequestContext() returning null | 911 // -Profile::GetDefaultRequestContext() returning null |
911 // (should not crash, but just do check later) | 912 // (should not crash, but just do check later) |
912 // -malformed update url (empty, file://, has query, has a # fragment, etc.) | 913 // -malformed update url (empty, file://, has query, has a # fragment, etc.) |
913 // -An extension gets uninstalled while updates are in progress (so it doesn't | 914 // -An extension gets uninstalled while updates are in progress (so it doesn't |
914 // "come back from the dead") | 915 // "come back from the dead") |
915 // -An extension gets manually updated to v3 while we're downloading v2 (ie | 916 // -An extension gets manually updated to v3 while we're downloading v2 (ie |
916 // you don't get downgraded accidentally) | 917 // you don't get downgraded accidentally) |
917 // -An update manifest mentions multiple updates | 918 // -An update manifest mentions multiple updates |
OLD | NEW |