OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // Unit tests for GoogleChromeDistribution class. | 5 // Unit tests for GoogleChromeDistribution class. |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "chrome/common/json_value_serializer.h" | 10 #include "chrome/common/json_value_serializer.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 L"&launch_count=11&page_load_count=68" | 45 L"&launch_count=11&page_load_count=68" |
46 L"&uptime_sec=809"); | 46 L"&uptime_sec=809"); |
47 | 47 |
48 JSONStringValueSerializer json_deserializer(pref_string); | 48 JSONStringValueSerializer json_deserializer(pref_string); |
49 std::string error_message; | 49 std::string error_message; |
50 | 50 |
51 scoped_ptr<Value> root(json_deserializer.Deserialize(NULL, &error_message)); | 51 scoped_ptr<Value> root(json_deserializer.Deserialize(NULL, &error_message)); |
52 ASSERT_TRUE(root.get()); | 52 ASSERT_TRUE(root.get()); |
53 std::wstring uninstall_metrics_string; | 53 std::wstring uninstall_metrics_string; |
54 | 54 |
55 const installer::MasterPreferences& prefs = | 55 const installer_util::MasterPreferences& prefs = |
56 installer::MasterPreferences::ForCurrentProcess(); | 56 installer_util::MasterPreferences::ForCurrentProcess(); |
57 | 57 |
58 GoogleChromeDistribution* dist = static_cast<GoogleChromeDistribution*>( | 58 GoogleChromeDistribution* dist = static_cast<GoogleChromeDistribution*>( |
59 BrowserDistribution::GetSpecificDistribution( | 59 BrowserDistribution::GetSpecificDistribution( |
60 BrowserDistribution::CHROME_BROWSER, prefs)); | 60 BrowserDistribution::CHROME_BROWSER, prefs)); |
61 | 61 |
62 EXPECT_TRUE( | 62 EXPECT_TRUE( |
63 dist->ExtractUninstallMetrics(*static_cast<DictionaryValue*>(root.get()), | 63 dist->ExtractUninstallMetrics(*static_cast<DictionaryValue*>(root.get()), |
64 &uninstall_metrics_string)); | 64 &uninstall_metrics_string)); |
65 EXPECT_EQ(expected_url_string, uninstall_metrics_string); | 65 EXPECT_EQ(expected_url_string, uninstall_metrics_string); |
66 } | 66 } |
67 #endif // defined(GOOGLE_CHROME_BUILD) | 67 #endif // defined(GOOGLE_CHROME_BUILD) |
OLD | NEW |