#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/message_loop/message_loop_proxy.h"
+#include "base/path_service.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
}
// TestURLRequestContextGetter:
- virtual TestURLRequestContext* GetURLRequestContext() OVERRIDE {
- return context_;
- }
+ TestURLRequestContext* GetURLRequestContext() override { return context_; }
protected:
- virtual ~ThrottlingTestURLRequestContextGetter() {}
+ ~ThrottlingTestURLRequestContextGetter() override {}
TestURLRequestContext* const context_;
};
// Subclasses that override this should either call this function or
// CleanupAfterFetchComplete() at the end of their processing, depending on
// whether they want to check for a non-empty HTTP 200 response or not.
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
// Deletes |fetcher| and terminates the message loop.
void CleanupAfterFetchComplete();
protected:
// testing::Test:
- virtual void SetUp() OVERRIDE {
+ void SetUp() override {
testing::Test::SetUp();
context_.reset(new ThrottlingTestURLRequestContext());
#endif
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() override {
#if defined(USE_NSS) || defined(OS_IOS)
ShutdownNSSHttpIO();
#endif
class URLFetcherMockDnsTest : public URLFetcherTest {
public:
// testing::Test:
- virtual void SetUp() OVERRIDE;
+ void SetUp() override;
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
protected:
GURL test_url_;
class URLFetcherPostTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
};
// Version of URLFetcherTest that does a POST of a file using
}
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
private:
base::FilePath path_;
class URLFetcherEmptyPostTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
};
// Version of URLFetcherTest that tests download progress reports.
}
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchDownloadProgress(const URLFetcher* source,
- int64 current,
- int64 total) OVERRIDE;
+ void OnURLFetchDownloadProgress(const URLFetcher* source,
+ int64 current,
+ int64 total) override;
protected:
// Download progress returned by the previous callback.
class URLFetcherDownloadProgressCancelTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
- virtual void OnURLFetchDownloadProgress(const URLFetcher* source,
- int64 current,
- int64 total) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
+ void OnURLFetchDownloadProgress(const URLFetcher* source,
+ int64 current,
+ int64 total) override;
+
protected:
bool cancelled_;
};
class URLFetcherUploadProgressTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchUploadProgress(const URLFetcher* source,
- int64 current,
- int64 total) OVERRIDE;
+ void OnURLFetchUploadProgress(const URLFetcher* source,
+ int64 current,
+ int64 total) override;
+
protected:
int64 previous_progress_;
std::string chunk_;
class URLFetcherHeadersTest : public URLFetcherTest {
public:
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
};
// Version of URLFetcherTest that tests SocketAddress.
class URLFetcherSocketAddressTest : public URLFetcherTest {
public:
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
+
protected:
std::string expected_host_;
uint16 expected_port_;
class URLFetcherStopOnRedirectTest : public URLFetcherTest {
public:
URLFetcherStopOnRedirectTest();
- virtual ~URLFetcherStopOnRedirectTest();
+ ~URLFetcherStopOnRedirectTest() override;
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
protected:
// The URL we should be redirected to.
class URLFetcherProtectTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
+
private:
Time start_time_;
};
class URLFetcherProtectTestPassedThrough : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
+
private:
Time start_time_;
};
URLFetcherBadHTTPSTest();
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
private:
base::FilePath cert_dir_;
class URLFetcherCancelTest : public URLFetcherTest {
public:
// URLFetcherTest:
- virtual void CreateFetcher(const GURL& url) OVERRIDE;
+ void CreateFetcher(const GURL& url) override;
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
void CancelRequest();
};
}
private:
- virtual ~CancelTestURLRequestContext() {
+ ~CancelTestURLRequestContext() override {
// The d'tor should execute in the IO thread. Post the quit task to the
// current thread.
base::MessageLoop::current()->PostTask(FROM_HERE,
}
// TestURLRequestContextGetter:
- virtual TestURLRequestContext* GetURLRequestContext() OVERRIDE {
+ TestURLRequestContext* GetURLRequestContext() override {
if (!context_.get()) {
context_.reset(new CancelTestURLRequestContext());
DCHECK(context_->throttler_manager());
}
protected:
- virtual ~CancelTestURLRequestContextGetter() {}
+ ~CancelTestURLRequestContextGetter() override {}
private:
scoped_ptr<TestURLRequestContext> context_;
class URLFetcherMultipleAttemptTest : public URLFetcherTest {
public:
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
+
private:
std::string data_;
};
void CreateFetcherForTempFile(const GURL& url);
// URLFetcherDelegate:
- virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE;
+ void OnURLFetchComplete(const URLFetcher* source) override;
protected:
base::FilePath expected_file_;