Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Unified Diff: sync/internal_api/attachments/attachment_downloader_impl_unittest.cc

Issue 2007373004: Fix test expectations to use bool checks rather than null compares (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/fake_datagram_socket.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/attachments/attachment_downloader_impl_unittest.cc
diff --git a/sync/internal_api/attachments/attachment_downloader_impl_unittest.cc b/sync/internal_api/attachments/attachment_downloader_impl_unittest.cc
index 4de03ed16c5d2da0aaa797bf94935a536f6c0935..5796c75c8b77c7e216aa0b2eee5ff79f8df7c382 100644
--- a/sync/internal_api/attachments/attachment_downloader_impl_unittest.cc
+++ b/sync/internal_api/attachments/attachment_downloader_impl_unittest.cc
@@ -70,7 +70,7 @@ class MockOAuth2TokenService : public FakeOAuth2TokenService {
void MockOAuth2TokenService::RespondToAccessTokenRequest(
GoogleServiceAuthError error) {
- EXPECT_TRUE(last_request_ != NULL);
+ EXPECT_TRUE(last_request_);
std::string access_token;
base::Time expiration_time;
if (error == GoogleServiceAuthError::AuthErrorNone()) {
@@ -94,7 +94,7 @@ void MockOAuth2TokenService::FetchOAuth2Token(
const std::string& client_secret,
const ScopeSet& scopes) {
// Only one request at a time is allowed.
- EXPECT_TRUE(last_request_ == NULL);
+ EXPECT_FALSE(last_request_);
last_request_ = request->AsWeakPtr();
}
@@ -233,7 +233,7 @@ void AttachmentDownloaderImplTest::CompleteDownload(
// TestURLFetcherFactory remembers last active URLFetcher.
net::TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(0);
// There should be outstanding url fetch request.
- EXPECT_TRUE(fetcher != NULL);
+ EXPECT_TRUE(fetcher);
fetcher->set_status(net::URLRequestStatus());
fetcher->set_response_code(response_code);
if (response_code == net::HTTP_OK) {
@@ -247,7 +247,7 @@ void AttachmentDownloaderImplTest::CompleteDownload(
RunMessageLoop();
// Once result is processed URLFetcher should be deleted.
fetcher = url_fetcher_factory_.GetFetcherByID(0);
- EXPECT_TRUE(fetcher == NULL);
+ EXPECT_FALSE(fetcher);
}
void AttachmentDownloaderImplTest::DownloadDone(
@@ -258,14 +258,14 @@ void AttachmentDownloaderImplTest::DownloadDone(
if (result == AttachmentDownloader::DOWNLOAD_SUCCESS) {
// Successful download should be accompanied by valid attachment with
// matching id and valid data.
- EXPECT_TRUE(attachment != NULL);
+ EXPECT_TRUE(attachment);
EXPECT_EQ(attachment_id, attachment->GetId());
scoped_refptr<base::RefCountedMemory> data = attachment->GetData();
std::string data_as_string(data->front_as<char>(), data->size());
EXPECT_EQ(data_as_string, kAttachmentContent);
} else {
- EXPECT_TRUE(attachment == NULL);
+ EXPECT_FALSE(attachment);
}
++num_completed_downloads_;
}
« no previous file with comments | « remoting/protocol/fake_datagram_socket.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698