| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS 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 <unistd.h> | 5 #include <unistd.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "glib.h" | 14 #include "glib.h" |
| 15 #include "gtest/gtest.h" | 15 #include "gtest/gtest.h" |
| 16 #include "update_engine/libcurl_http_fetcher.h" | 16 #include "update_engine/libcurl_http_fetcher.h" |
| 17 #include "update_engine/mock_http_fetcher.h" | 17 #include "update_engine/mock_http_fetcher.h" |
| 18 #include "update_engine/multi_http_fetcher.h" | 18 #include "update_engine/multi_http_fetcher.h" |
| 19 | 19 |
| 20 using std::make_pair; | 20 using std::make_pair; |
| 21 using std::string; | 21 using std::string; |
| 22 using std::vector; | 22 using std::vector; |
| 23 | 23 |
| 24 namespace chromeos_update_engine { | 24 namespace chromeos_update_engine { |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 // WARNING, if you update these, you must also update test_http_server.py | 27 // WARNING, if you update these, you must also update test_http_server.cc. |
| 28 const char* const kServerPort = "8080"; | 28 const char* const kServerPort = "8088"; |
| 29 const int kBigSize = 100000; | 29 const int kBigSize = 100000; |
| 30 string LocalServerUrlForPath(const string& path) { | 30 string LocalServerUrlForPath(const string& path) { |
| 31 return string("http://127.0.0.1:") + kServerPort + path; | 31 return string("http://127.0.0.1:") + kServerPort + path; |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 | 34 |
| 35 template <typename T> | 35 template <typename T> |
| 36 class HttpFetcherTest : public ::testing::Test { | 36 class HttpFetcherTest : public ::testing::Test { |
| 37 public: | 37 public: |
| 38 HttpFetcher* NewLargeFetcher() = 0; | 38 HttpFetcher* NewLargeFetcher() = 0; |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 StartTransferArgs start_xfer_args = | 745 StartTransferArgs start_xfer_args = |
| 746 { fetcher.get(), LocalServerUrlForPath(this->SmallUrl()) }; | 746 { fetcher.get(), LocalServerUrlForPath(this->SmallUrl()) }; |
| 747 | 747 |
| 748 g_timeout_add(0, StartTransfer, &start_xfer_args); | 748 g_timeout_add(0, StartTransfer, &start_xfer_args); |
| 749 g_main_loop_run(loop); | 749 g_main_loop_run(loop); |
| 750 g_main_loop_unref(loop); | 750 g_main_loop_unref(loop); |
| 751 } | 751 } |
| 752 } | 752 } |
| 753 | 753 |
| 754 } // namespace chromeos_update_engine | 754 } // namespace chromeos_update_engine |
| OLD | NEW |