diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-05-07 19:57:12 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-05-13 13:54:16 -0700 |
commit | 386be7c0faf20220f1e25b1a29f478519d1e2aa9 (patch) | |
tree | 1ed1c4f6f8007111bda59c32c974cfb47c71ec8c /test | |
parent | 1d38b636402a6581c491185090f5c81495a07d13 (diff) | |
download | qtlocation-mapboxgl-386be7c0faf20220f1e25b1a29f478519d1e2aa9.tar.gz |
Remove unused
There are no longer any requests made that don't have a run loop to
dispatch back to.
Diffstat (limited to 'test')
-rw-r--r-- | test/storage/http_noloop.cpp | 38 | ||||
-rw-r--r-- | test/storage/http_reading.cpp | 17 | ||||
-rw-r--r-- | test/test.gypi | 1 |
3 files changed, 0 insertions, 56 deletions
diff --git a/test/storage/http_noloop.cpp b/test/storage/http_noloop.cpp deleted file mode 100644 index e133d3e0c2..0000000000 --- a/test/storage/http_noloop.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "storage.hpp" - -#include <uv.h> - -#include <mbgl/storage/default_file_source.hpp> -#include <mbgl/util/uv.hpp> - -TEST_F(Storage, HTTPNoLoop) { - SCOPED_TEST(HTTPNoLoop) - - using namespace mbgl; - - DefaultFileSource fs(nullptr); - - const auto mainThread = uv_thread_self(); - - // Async handle that keeps the main loop alive until the thread finished - auto async = new uv_async_t; - uv_async_init(uv_default_loop(), async, [] (uv_async_t *as, int) { - uv::close(as); - }); - - fs.request({ Resource::Unknown, "http://127.0.0.1:3000/temporary-error" }, nullptr, - [&](const Response &res) { - EXPECT_NE(uv_thread_self(), mainThread) << "Response was called in the same thread"; - EXPECT_EQ(Response::Successful, res.status); - EXPECT_EQ("Hello World!", res.data); - EXPECT_EQ(0, res.expires); - EXPECT_EQ(0, res.modified); - EXPECT_EQ("", res.etag); - EXPECT_EQ("", res.message); - HTTPNoLoop.finish(); - - uv_async_send(async); - }); - - uv_run(uv_default_loop(), UV_RUN_DEFAULT); -} diff --git a/test/storage/http_reading.cpp b/test/storage/http_reading.cpp index 09d33fd6ab..b322bbf2a7 100644 --- a/test/storage/http_reading.cpp +++ b/test/storage/http_reading.cpp @@ -56,20 +56,3 @@ TEST_F(Storage, HTTPNoCallback) { HTTPTest.finish(); } - -TEST_F(Storage, HTTPCallbackNotOnLoop) { - using namespace mbgl; - - DefaultFileSource fs(nullptr); - - SCOPED_TEST(HTTPTest) - - std::promise<void> promise; - fs.request({ Resource::Unknown, "http://127.0.0.1:3000/test" }, [&] (const Response &) { - promise.set_value(); - }); - - promise.get_future().get(); - - HTTPTest.finish(); -} diff --git a/test/test.gypi b/test/test.gypi index 03bceaae4b..75301751cf 100644 --- a/test/test.gypi +++ b/test/test.gypi @@ -71,7 +71,6 @@ 'storage/http_header_parsing.cpp', 'storage/http_issue_1369.cpp', 'storage/http_load.cpp', - 'storage/http_noloop.cpp', 'storage/http_other_loop.cpp', 'storage/http_reading.cpp', ], |