OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/update_client/utils.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 #include "url/gurl.h" |
| 8 |
| 9 using std::string; |
| 10 |
| 11 namespace update_client { |
| 12 |
| 13 TEST(BuildProtocolRequest, DownloadPreference) { |
| 14 const string emptystr; |
| 15 |
| 16 // Verifies that an empty |download_preference| is not serialized. |
| 17 const string request_no_dlpref = BuildProtocolRequest( |
| 18 emptystr, emptystr, emptystr, emptystr, emptystr, emptystr, emptystr); |
| 19 EXPECT_EQ(string::npos, request_no_dlpref.find(" dlpref=")); |
| 20 |
| 21 // Verifies that |download_preference| is serialized. |
| 22 const string request_with_dlpref = BuildProtocolRequest( |
| 23 emptystr, emptystr, emptystr, emptystr, "some pref", emptystr, emptystr); |
| 24 EXPECT_NE(string::npos, request_with_dlpref.find(" dlpref=\"some pref\"")); |
| 25 } |
| 26 |
| 27 } // namespace update_client |
OLD | NEW |