diff options
26 files changed, 115 insertions, 190 deletions
diff --git a/base/file_version_info_unittest.cc b/base/file_version_info_unittest.cc index 4e058f4..2b535c7 100644 --- a/base/file_version_info_unittest.cc +++ b/base/file_version_info_unittest.cc @@ -17,6 +17,7 @@ namespace { class FileVersionInfoTest : public testing::Test { }; +#if defined(OS_WIN) FilePath GetTestDataPath() { FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); @@ -25,6 +26,7 @@ FilePath GetTestDataPath() { path = path.AppendASCII("file_version_info_unittest"); return path; } +#endif } diff --git a/base/string_util_unittest.cc b/base/string_util_unittest.cc index 8163ba0..617b0eb 100644 --- a/base/string_util_unittest.cc +++ b/base/string_util_unittest.cc @@ -18,31 +18,6 @@ using ::testing::ElementsAre; namespace base { -namespace { - -// Given a null-terminated string of wchar_t with each wchar_t representing -// a UTF-16 code unit, returns a string16 made up of wchar_t's in the input. -// Each wchar_t should be <= 0xFFFF and a non-BMP character (> U+FFFF) -// should be represented as a surrogate pair (two UTF-16 units) -// *even* where wchar_t is 32-bit (Linux and Mac). -// -// This is to help write tests for functions with string16 params until -// the C++ 0x UTF-16 literal is well-supported by compilers. -string16 BuildString16(const wchar_t* s) { -#if defined(WCHAR_T_IS_UTF16) - return string16(s); -#elif defined(WCHAR_T_IS_UTF32) - string16 u16; - while (*s != 0) { - DCHECK_LE(static_cast<unsigned int>(*s), 0xFFFFu); - u16.push_back(*s++); - } - return u16; -#endif -} - -} // namespace - static const struct trim_case { const wchar_t* input; const TrimPositions positions; diff --git a/base/thread_local_unittest.cc b/base/thread_local_unittest.cc index 9653e15..7632c56 100644 --- a/base/thread_local_unittest.cc +++ b/base/thread_local_unittest.cc @@ -142,18 +142,18 @@ TEST(ThreadLocalTest, Pointer) { TEST(ThreadLocalTest, Boolean) { { base::ThreadLocalBoolean tlb; - EXPECT_EQ(false, tlb.Get()); + EXPECT_FALSE(tlb.Get()); tlb.Set(false); - EXPECT_EQ(false, tlb.Get()); + EXPECT_FALSE(tlb.Get()); tlb.Set(true); - EXPECT_EQ(true, tlb.Get()); + EXPECT_TRUE(tlb.Get()); } // Our slot should have been freed, we're all reset. { base::ThreadLocalBoolean tlb; - EXPECT_EQ(false, tlb.Get()); + EXPECT_FALSE(tlb.Get()); } } diff --git a/base/utf_string_conversions_unittest.cc b/base/utf_string_conversions_unittest.cc index 2687a55..7c180a6 100644 --- a/base/utf_string_conversions_unittest.cc +++ b/base/utf_string_conversions_unittest.cc @@ -13,27 +13,6 @@ namespace base { namespace { -// Given a null-terminated string of wchar_t with each wchar_t representing -// a UTF-16 code unit, returns a string16 made up of wchar_t's in the input. -// Each wchar_t should be <= 0xFFFF and a non-BMP character (> U+FFFF) -// should be represented as a surrogate pair (two UTF-16 units) -// *even* where wchar_t is 32-bit (Linux and Mac). -// -// This is to help write tests for functions with string16 params until -// the C++ 0x UTF-16 literal is well-supported by compilers. -string16 BuildString16(const wchar_t* s) { -#if defined(WCHAR_T_IS_UTF16) - return string16(s); -#elif defined(WCHAR_T_IS_UTF32) - string16 u16; - while (*s != 0) { - DCHECK_LE(static_cast<unsigned int>(*s), 0xFFFFu); - u16.push_back(*s++); - } - return u16; -#endif -} - const wchar_t* const kConvertRoundtripCases[] = { L"Google Video", // "网页 图片 资讯更多 »" diff --git a/chrome/common/render_messages_unittest.cc b/chrome/common/render_messages_unittest.cc index d45d5df..b24efde 100644 --- a/chrome/common/render_messages_unittest.cc +++ b/chrome/common/render_messages_unittest.cc @@ -7,6 +7,7 @@ #include "base/utf_string_conversions.h" #include "chrome/common/render_messages.h" #include "testing/gtest/include/gtest/gtest.h" +#include "webkit/glue/web_io_operators.h" #include "webkit/glue/webaccessibility.h" #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" diff --git a/chrome/test/live_sync/live_autofill_sync_test.h b/chrome/test/live_sync/live_autofill_sync_test.h index 279641e..9eff1f5 100644 --- a/chrome/test/live_sync/live_autofill_sync_test.h +++ b/chrome/test/live_sync/live_autofill_sync_test.h @@ -29,11 +29,11 @@ using base::WaitableEvent; using testing::_; -namespace { // Define these << operators so we can use EXPECT_EQ with the // AutofillKeys type. template<class T1, class T2, class T3> -std::ostream& operator<<(std::ostream& os, const std::set<T1, T2, T3>& seq) { +static std::ostream& operator<<( + std::ostream& os, const std::set<T1, T2, T3>& seq) { typedef typename std::set<T1, T2, T3>::const_iterator SetConstIterator; for (SetConstIterator i = seq.begin(); i != seq.end(); ++i) { os << *i << ", "; @@ -41,10 +41,11 @@ std::ostream& operator<<(std::ostream& os, const std::set<T1, T2, T3>& seq) { return os; } -std::ostream& operator<<(std::ostream& os, const AutofillKey& key) { +static std::ostream& operator<<(std::ostream& os, const AutofillKey& key) { return os << UTF16ToUTF8(key.name()) << ", " << UTF16ToUTF8(key.value()); } +namespace { class GetAllAutofillEntries : public base::RefCountedThreadSafe<GetAllAutofillEntries> { public: diff --git a/gfx/rect.cc b/gfx/rect.cc index 1d9be1f..e9c666c 100644 --- a/gfx/rect.cc +++ b/gfx/rect.cc @@ -241,8 +241,8 @@ bool Rect::SharesEdgeWith(const gfx::Rect& rect) const { (y() == rect.bottom() || bottom() == rect.y())); } -} // namespace gfx - std::ostream& operator<<(std::ostream& out, const gfx::Rect& r) { return out << r.origin() << " " << r.size(); } + +} // namespace gfx @@ -173,8 +173,8 @@ class Rect { gfx::Size size_; }; -} // namespace gfx - std::ostream& operator<<(std::ostream& out, const gfx::Rect& r); +} // namespace gfx + #endif // GFX_RECT_H_ diff --git a/gfx/size.cc b/gfx/size.cc index e39a2d7..6e5528e 100644 --- a/gfx/size.cc +++ b/gfx/size.cc @@ -63,8 +63,8 @@ void Size::set_height(int height) { height_ = height; } -} // namespace gfx - std::ostream& operator<<(std::ostream& out, const gfx::Size& s) { return out << s.width() << "x" << s.height(); } + +} // namespace gfx @@ -75,8 +75,8 @@ class Size { int height_; }; -} // namespace gfx - std::ostream& operator<<(std::ostream& out, const gfx::Size& s); +} // namespace gfx + #endif // GFX_SIZE_H_ diff --git a/ipc/ipc_send_fds_test.cc b/ipc/ipc_send_fds_test.cc index 7001574..e1f19dc 100644 --- a/ipc/ipc_send_fds_test.cc +++ b/ipc/ipc_send_fds_test.cc @@ -125,7 +125,9 @@ MULTIPROCESS_TEST_MAIN(RunTestDescriptorClientSandboxed) { struct stat st; const int fd = open(kDevZeroPath, O_RDONLY); fstat(fd, &st); - HANDLE_EINTR(close(fd)); + if (HANDLE_EINTR(close(fd)) < 0) { + return -1; + } // Enable the Sandbox. char* error_buff = NULL; diff --git a/media/base/clock_impl_unittest.cc b/media/base/clock_impl_unittest.cc index c23c18ec3..87f3a5e 100644 --- a/media/base/clock_impl_unittest.cc +++ b/media/base/clock_impl_unittest.cc @@ -11,12 +11,12 @@ using ::testing::InSequence; using ::testing::Return; using ::testing::StrictMock; -namespace { +namespace base { // Provide a stream output operator so we can use EXPECT_EQ(...) with TimeDelta. // // TODO(scherkus): move this into the testing package. -std::ostream& operator<<(std::ostream& stream, const base::TimeDelta& time) { +static std::ostream& operator<<(std::ostream& stream, const TimeDelta& time) { return (stream << time.ToInternalValue()); } diff --git a/net/base/cookie_monster_unittest.cc b/net/base/cookie_monster_unittest.cc index 34a9635..f4cca57 100644 --- a/net/base/cookie_monster_unittest.cc +++ b/net/base/cookie_monster_unittest.cc @@ -1518,16 +1518,16 @@ TEST(CookieMonsterTest, Delegate) { EXPECT_TRUE(cm->SetCookie(url_google, "E=F")); EXPECT_EQ("A=B; C=D; E=F", cm->GetCookies(url_google)); ASSERT_EQ(3u, delegate->changes().size()); - EXPECT_EQ(false, delegate->changes()[0].second); + EXPECT_FALSE(delegate->changes()[0].second); EXPECT_EQ(url_google.host(), delegate->changes()[0].first.Domain()); EXPECT_EQ("A", delegate->changes()[0].first.Name()); EXPECT_EQ("B", delegate->changes()[0].first.Value()); EXPECT_EQ(url_google.host(), delegate->changes()[1].first.Domain()); - EXPECT_EQ(false, delegate->changes()[1].second); + EXPECT_FALSE(delegate->changes()[1].second); EXPECT_EQ("C", delegate->changes()[1].first.Name()); EXPECT_EQ("D", delegate->changes()[1].first.Value()); EXPECT_EQ(url_google.host(), delegate->changes()[2].first.Domain()); - EXPECT_EQ(false, delegate->changes()[2].second); + EXPECT_FALSE(delegate->changes()[2].second); EXPECT_EQ("E", delegate->changes()[2].first.Name()); EXPECT_EQ("F", delegate->changes()[2].first.Value()); delegate->reset(); @@ -1536,7 +1536,7 @@ TEST(CookieMonsterTest, Delegate) { EXPECT_EQ("A=B; E=F", cm->GetCookies(url_google)); ASSERT_EQ(1u, delegate->changes().size()); EXPECT_EQ(url_google.host(), delegate->changes()[0].first.Domain()); - EXPECT_EQ(true, delegate->changes()[0].second); + EXPECT_TRUE(delegate->changes()[0].second); EXPECT_EQ("C", delegate->changes()[0].first.Name()); EXPECT_EQ("D", delegate->changes()[0].first.Value()); delegate->reset(); @@ -1552,7 +1552,7 @@ TEST(CookieMonsterTest, Delegate) { ASSERT_EQ(1u, store->commands().size()); EXPECT_EQ(CookieStoreCommand::ADD, store->commands()[0].type); ASSERT_EQ(1u, delegate->changes().size()); - EXPECT_EQ(false, delegate->changes()[0].second); + EXPECT_FALSE(delegate->changes()[0].second); EXPECT_EQ(url_google.host(), delegate->changes()[0].first.Domain()); EXPECT_EQ("a", delegate->changes()[0].first.Name()); EXPECT_EQ("val1", delegate->changes()[0].first.Value()); @@ -1572,11 +1572,11 @@ TEST(CookieMonsterTest, Delegate) { EXPECT_EQ(CookieStoreCommand::ADD, store->commands()[2].type); ASSERT_EQ(2u, delegate->changes().size()); EXPECT_EQ(url_google.host(), delegate->changes()[0].first.Domain()); - EXPECT_EQ(true, delegate->changes()[0].second); + EXPECT_TRUE(delegate->changes()[0].second); EXPECT_EQ("a", delegate->changes()[0].first.Name()); EXPECT_EQ("val1", delegate->changes()[0].first.Value()); EXPECT_EQ(url_google.host(), delegate->changes()[1].first.Domain()); - EXPECT_EQ(false, delegate->changes()[1].second); + EXPECT_FALSE(delegate->changes()[1].second); EXPECT_EQ("a", delegate->changes()[1].first.Name()); EXPECT_EQ("val2", delegate->changes()[1].first.Value()); delegate->reset(); diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc index 51b7f3a..d4f3a3f 100644 --- a/net/base/mime_util_unittest.cc +++ b/net/base/mime_util_unittest.cc @@ -62,39 +62,35 @@ TEST(MimeUtilTest, FileTest) { } TEST(MimeUtilTest, LookupTypes) { - EXPECT_EQ(true, net::IsSupportedImageMimeType("image/jpeg")); - EXPECT_EQ(false, net::IsSupportedImageMimeType("image/lolcat")); - EXPECT_EQ(true, net::IsSupportedNonImageMimeType("text/html")); - EXPECT_EQ(false, net::IsSupportedNonImageMimeType("text/virus")); + EXPECT_TRUE(net::IsSupportedImageMimeType("image/jpeg")); + EXPECT_FALSE(net::IsSupportedImageMimeType("image/lolcat")); + EXPECT_TRUE(net::IsSupportedNonImageMimeType("text/html")); + EXPECT_FALSE(net::IsSupportedNonImageMimeType("text/virus")); - EXPECT_EQ(true, net::IsSupportedMimeType("image/jpeg")); - EXPECT_EQ(false, net::IsSupportedMimeType("image/lolcat")); - EXPECT_EQ(true, net::IsSupportedMimeType("text/html")); - EXPECT_EQ(false, net::IsSupportedMimeType("text/virus")); + EXPECT_TRUE(net::IsSupportedMimeType("image/jpeg")); + EXPECT_FALSE(net::IsSupportedMimeType("image/lolcat")); + EXPECT_TRUE(net::IsSupportedMimeType("text/html")); + EXPECT_FALSE(net::IsSupportedMimeType("text/virus")); } TEST(MimeUtilTest, MatchesMimeType) { - EXPECT_EQ(true, net::MatchesMimeType("*", "video/x-mpeg")); - EXPECT_EQ(true, net::MatchesMimeType("video/*", "video/x-mpeg")); - EXPECT_EQ(true, net::MatchesMimeType("video/x-mpeg", "video/x-mpeg")); - EXPECT_EQ(true, net::MatchesMimeType("application/*+xml", - "application/html+xml")); - EXPECT_EQ(true, net::MatchesMimeType("application/*+xml", - "application/+xml")); - EXPECT_EQ(true, net::MatchesMimeType("aaa*aaa", - "aaaaaa")); - EXPECT_EQ(false, net::MatchesMimeType("video/", "video/x-mpeg")); - EXPECT_EQ(false, net::MatchesMimeType("", "video/x-mpeg")); - EXPECT_EQ(false, net::MatchesMimeType("", "")); - EXPECT_EQ(false, net::MatchesMimeType("video/x-mpeg", "")); - EXPECT_EQ(false, net::MatchesMimeType("application/*+xml", - "application/xml")); - EXPECT_EQ(false, net::MatchesMimeType("application/*+xml", - "application/html+xmlz")); - EXPECT_EQ(false, net::MatchesMimeType("application/*+xml", - "applcation/html+xml")); - EXPECT_EQ(false, net::MatchesMimeType("aaa*aaa", - "aaaaa")); + EXPECT_TRUE(net::MatchesMimeType("*", "video/x-mpeg")); + EXPECT_TRUE(net::MatchesMimeType("video/*", "video/x-mpeg")); + EXPECT_TRUE(net::MatchesMimeType("video/x-mpeg", "video/x-mpeg")); + EXPECT_TRUE(net::MatchesMimeType("application/*+xml", + "application/html+xml")); + EXPECT_TRUE(net::MatchesMimeType("application/*+xml", "application/+xml")); + EXPECT_TRUE(net::MatchesMimeType("aaa*aaa", "aaaaaa")); + EXPECT_FALSE(net::MatchesMimeType("video/", "video/x-mpeg")); + EXPECT_FALSE(net::MatchesMimeType("", "video/x-mpeg")); + EXPECT_FALSE(net::MatchesMimeType("", "")); + EXPECT_FALSE(net::MatchesMimeType("video/x-mpeg", "")); + EXPECT_FALSE(net::MatchesMimeType("application/*+xml", "application/xml")); + EXPECT_FALSE(net::MatchesMimeType("application/*+xml", + "application/html+xmlz")); + EXPECT_FALSE(net::MatchesMimeType("application/*+xml", + "applcation/html+xml")); + EXPECT_FALSE(net::MatchesMimeType("aaa*aaa", "aaaaa")); } // Note: codecs should only be a list of 2 or fewer; hence the restriction of diff --git a/net/base/net_log_unittest.h b/net/base/net_log_unittest.h index 77a9cbd7..5e77275 100644 --- a/net/base/net_log_unittest.h +++ b/net/base/net_log_unittest.h @@ -28,7 +28,9 @@ inline ::testing::AssertionResult LogContainsEventHelper( NetLog::EventType expected_event, NetLog::EventPhase expected_phase) { // Negative indices are reverse indices. - size_t j = (i < 0) ? entries.size() + i : i; + size_t j = (i < 0) ? + static_cast<size_t>(static_cast<int>(entries.size()) + i) : + static_cast<size_t>(i); if (j >= entries.size()) return ::testing::AssertionFailure() << j << " is out of bounds."; const CapturingNetLog::Entry& entry = entries[j]; @@ -95,7 +97,9 @@ inline ::testing::AssertionResult LogContainsEntryWithType( int i, // Negative indices are reverse indices. NetLog::EventType type) { // Negative indices are reverse indices. - size_t j = (i < 0) ? entries.size() + i : i; + size_t j = (i < 0) ? + static_cast<size_t>(static_cast<int>(entries.size()) + i) : + static_cast<size_t>(i); if (j >= entries.size()) return ::testing::AssertionFailure() << j << " is out of bounds."; const CapturingNetLog::Entry& entry = entries[j]; diff --git a/net/base/registry_controlled_domain_unittest.cc b/net/base/registry_controlled_domain_unittest.cc index 09c173b..8c90c99 100644 --- a/net/base/registry_controlled_domain_unittest.cc +++ b/net/base/registry_controlled_domain_unittest.cc @@ -213,30 +213,30 @@ TEST_F(RegistryControlledDomainTest, TestSameDomainOrHost) { TestRegistryControlledDomainService::UseDomainData( Perfect_Hash_Test2::FindDomain); - EXPECT_EQ(true, CompareDomains("http://a.b.bar.jp/file.html", - "http://a.b.bar.jp/file.html")); // b.bar.jp - EXPECT_EQ(true, CompareDomains("http://a.b.bar.jp/file.html", - "http://b.b.bar.jp/file.html")); // b.bar.jp - EXPECT_EQ(false, CompareDomains("http://a.foo.jp/file.html", // foo.jp - "http://a.not.jp/file.html")); // not.jp - EXPECT_EQ(false, CompareDomains("http://a.foo.jp/file.html", // foo.jp - "http://a.foo.jp./file.html")); // foo.jp. - EXPECT_EQ(false, CompareDomains("http://a.com/file.html", // a.com - "http://b.com/file.html")); // b.com - EXPECT_EQ(true, CompareDomains("http://a.x.com/file.html", - "http://b.x.com/file.html")); // x.com - EXPECT_EQ(true, CompareDomains("http://a.x.com/file.html", - "http://.x.com/file.html")); // x.com - EXPECT_EQ(true, CompareDomains("http://a.x.com/file.html", - "http://..b.x.com/file.html")); // x.com - EXPECT_EQ(true, CompareDomains("http://intranet/file.html", - "http://intranet/file.html")); // intranet - EXPECT_EQ(true, CompareDomains("http://127.0.0.1/file.html", - "http://127.0.0.1/file.html")); // 127.0.0.1 - EXPECT_EQ(false, CompareDomains("http://192.168.0.1/file.html", // 192.168.0.1 - "http://127.0.0.1/file.html")); // 127.0.0.1 - EXPECT_EQ(false, CompareDomains("file:///C:/file.html", - "file:///C:/file.html")); // no host + EXPECT_TRUE(CompareDomains("http://a.b.bar.jp/file.html", + "http://a.b.bar.jp/file.html")); // b.bar.jp + EXPECT_TRUE(CompareDomains("http://a.b.bar.jp/file.html", + "http://b.b.bar.jp/file.html")); // b.bar.jp + EXPECT_FALSE(CompareDomains("http://a.foo.jp/file.html", // foo.jp + "http://a.not.jp/file.html")); // not.jp + EXPECT_FALSE(CompareDomains("http://a.foo.jp/file.html", // foo.jp + "http://a.foo.jp./file.html")); // foo.jp. + EXPECT_FALSE(CompareDomains("http://a.com/file.html", // a.com + "http://b.com/file.html")); // b.com + EXPECT_TRUE(CompareDomains("http://a.x.com/file.html", + "http://b.x.com/file.html")); // x.com + EXPECT_TRUE(CompareDomains("http://a.x.com/file.html", + "http://.x.com/file.html")); // x.com + EXPECT_TRUE(CompareDomains("http://a.x.com/file.html", + "http://..b.x.com/file.html")); // x.com + EXPECT_TRUE(CompareDomains("http://intranet/file.html", + "http://intranet/file.html")); // intranet + EXPECT_TRUE(CompareDomains("http://127.0.0.1/file.html", + "http://127.0.0.1/file.html")); // 127.0.0.1 + EXPECT_FALSE(CompareDomains("http://192.168.0.1/file.html", // 192.168.0.1 + "http://127.0.0.1/file.html")); // 127.0.0.1 + EXPECT_FALSE(CompareDomains("file:///C:/file.html", + "file:///C:/file.html")); // no host } TEST_F(RegistryControlledDomainTest, TestDefaultData) { diff --git a/net/base/ssl_config_service_mac_unittest.cc b/net/base/ssl_config_service_mac_unittest.cc index 0aa06f9..c94f213 100644 --- a/net/base/ssl_config_service_mac_unittest.cc +++ b/net/base/ssl_config_service_mac_unittest.cc @@ -38,10 +38,10 @@ class SSLConfigServiceMacTest : public testing::Test { TEST(SSLConfigServiceMacTest, GetNowTest) { // Verify that the constructor sets the correct default values. net::SSLConfig config; - EXPECT_EQ(true, config.rev_checking_enabled); - EXPECT_EQ(false, config.ssl2_enabled); - EXPECT_EQ(true, config.ssl3_enabled); - EXPECT_EQ(true, config.tls1_enabled); + EXPECT_TRUE(config.rev_checking_enabled); + EXPECT_FALSE(config.ssl2_enabled); + EXPECT_TRUE(config.ssl3_enabled); + EXPECT_TRUE(config.tls1_enabled); bool rv = net::SSLConfigServiceMac::GetSSLConfigNow(&config); EXPECT_TRUE(rv); diff --git a/net/disk_cache/mapped_file_unittest.cc b/net/disk_cache/mapped_file_unittest.cc index 8b01a7d..5802671 100644 --- a/net/disk_cache/mapped_file_unittest.cc +++ b/net/disk_cache/mapped_file_unittest.cc @@ -36,28 +36,6 @@ void FileCallbackTest::OnFileIOComplete(int bytes_copied) { g_cache_tests_received++; } -// Wait up to 2 secs without callbacks, or until we receive expected callbacks. -void WaitForCallbacks(int expected) { - if (!expected) - return; - -#if defined(OS_WIN) - int iterations = 0; - int last = 0; - while (iterations < 40) { - SleepEx(50, TRUE); - if (expected == g_cache_tests_received) - return; - if (last == g_cache_tests_received) - iterations++; - else - iterations = 0; - } -#elif defined(OS_POSIX) - // TODO(rvargas): Do something when async IO is implemented. -#endif -} - } // namespace TEST_F(DiskCacheTest, MappedFile_SyncIO) { diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index ad41eac..02d4a5f 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -3814,7 +3814,7 @@ TEST_F(HttpNetworkTransactionTest, ResetStateForRestart) { EXPECT_EQ(0U, trans->request_headers_.size()); EXPECT_TRUE(response->auth_challenge.get() == NULL); EXPECT_TRUE(response->headers.get() == NULL); - EXPECT_EQ(false, response->was_cached); + EXPECT_FALSE(response->was_cached); EXPECT_EQ(0, response->ssl_info.cert_status); EXPECT_FALSE(response->vary_data.is_valid()); } diff --git a/net/http/mock_gssapi_library_posix.cc b/net/http/mock_gssapi_library_posix.cc index d0a46b1..ec69964 100644 --- a/net/http/mock_gssapi_library_posix.cc +++ b/net/http/mock_gssapi_library_posix.cc @@ -52,21 +52,6 @@ void CopyOid(gss_OID dest, const gss_OID_desc* src) { SetOid(dest, src->elements, src->length); } -std::string OidToString(const gss_OID src) { - std::string dest; - if (!src) - return dest; - const char* string = reinterpret_cast<char*>(src->elements); - dest.assign(string, src->length); - return dest; -} - -void OidFromString(const std::string& src, gss_OID dest) { - if (!dest) - return; - SetOid(dest, src.c_str(), src.length()); -} - // gss_buffer_t helpers. void ClearBuffer(gss_buffer_t dest) { if (!dest) @@ -132,20 +117,6 @@ void SetName(gss_name_t dest, const void* src, size_t length) { name->name.assign(reinterpret_cast<const char*>(src), length); } -void CopyName(gss_name_t dest, const gss_name_t src) { - if (!dest) - return; - ClearName(dest); - if (!src) - return; - test::GssNameMockImpl* name_dst = - reinterpret_cast<test::GssNameMockImpl*>(dest); - test::GssNameMockImpl* name_src = - reinterpret_cast<test::GssNameMockImpl*>(dest); - name_dst->name = name_src->name; - CopyOid(&name_dst->name_type, &name_src->name_type); -} - std::string NameToString(const gss_name_t& src) { std::string dest; if (!src) diff --git a/net/http/url_security_manager_unittest.cc b/net/http/url_security_manager_unittest.cc index 45d93c9..d1e7623 100644 --- a/net/http/url_security_manager_unittest.cc +++ b/net/http/url_security_manager_unittest.cc @@ -88,7 +88,7 @@ TEST(URLSecurityManager, CanDelegate_NoWhitelist) { for (size_t i = 0; i < arraysize(kTestDataList); ++i) { GURL gurl(kTestDataList[i].url); bool can_delegate = url_security_manager->CanDelegate(gurl); - EXPECT_EQ(false, can_delegate); + EXPECT_FALSE(can_delegate); } } diff --git a/net/spdy/spdy_protocol_test.cc b/net/spdy/spdy_protocol_test.cc index e0b0591..40ba3df 100644 --- a/net/spdy/spdy_protocol_test.cc +++ b/net/spdy/spdy_protocol_test.cc @@ -72,13 +72,13 @@ TEST(SpdyProtocolTest, FrameStructs) { frame.set_flags(10); EXPECT_EQ(12345u, frame.length()); EXPECT_EQ(10u, frame.flags()); - EXPECT_EQ(false, frame.is_control_frame()); + EXPECT_FALSE(frame.is_control_frame()); frame.set_length(0); frame.set_flags(10); EXPECT_EQ(0u, frame.length()); EXPECT_EQ(10u, frame.flags()); - EXPECT_EQ(false, frame.is_control_frame()); + EXPECT_FALSE(frame.is_control_frame()); } TEST(SpdyProtocolTest, DataFrameStructs) { diff --git a/remoting/client/chromoting_view_unittest.cc b/remoting/client/chromoting_view_unittest.cc index 1856891..4301e5a 100644 --- a/remoting/client/chromoting_view_unittest.cc +++ b/remoting/client/chromoting_view_unittest.cc @@ -107,7 +107,7 @@ TEST(ChromotingViewTest, DecodeSimple) { Decoder* decoder = view->get_decoder(); ASSERT_TRUE(decoder != NULL); EXPECT_EQ(EncodingZlib, decoder->Encoding()); - EXPECT_EQ(false, decoder->IsStarted()); + EXPECT_FALSE(decoder->IsStarted()); // Overwrite |decoder_| with MockDecoder. MockDecoder* mock_decoder = new MockDecoder(); @@ -176,7 +176,7 @@ TEST(ChromotingViewTest, DecodeThreePackets) { Decoder* decoder = view->get_decoder(); ASSERT_TRUE(decoder != NULL); EXPECT_EQ(EncodingZlib, decoder->Encoding()); - EXPECT_EQ(false, decoder->IsStarted()); + EXPECT_FALSE(decoder->IsStarted()); // Overwrite |decoder_| with MockDecoder. MockDecoder* mock_decoder = new MockDecoder(); @@ -265,7 +265,7 @@ TEST(ChromotingViewTest, DecodeTwoStreams) { Decoder* decoder = view->get_decoder(); ASSERT_TRUE(decoder != NULL); EXPECT_EQ(EncodingZlib, decoder->Encoding()); - EXPECT_EQ(false, decoder->IsStarted()); + EXPECT_FALSE(decoder->IsStarted()); // Overwrite |decoder_| with MockDecoder. MockDecoder* mock_decoder = new MockDecoder(); @@ -373,7 +373,7 @@ TEST(ChromotingViewTest, DecodeTwoStreamsDifferentEncodings) { Decoder* decoder = view->get_decoder(); ASSERT_TRUE(decoder != NULL); EXPECT_EQ(EncodingZlib, decoder->Encoding()); - EXPECT_EQ(false, decoder->IsStarted()); + EXPECT_FALSE(decoder->IsStarted()); // Overwrite |decoder_| with MockDecoder. MockDecoder* mock_decoder1 = new MockDecoder(); @@ -489,7 +489,7 @@ TEST(ChromotingViewTest, MismatchedEncodings) { Decoder* decoder = view->get_decoder(); ASSERT_TRUE(decoder != NULL); EXPECT_EQ(EncodingZlib, decoder->Encoding()); - EXPECT_EQ(false, decoder->IsStarted()); + EXPECT_FALSE(decoder->IsStarted()); // Overwrite |decoder_| with MockDecoder. MockDecoder* mock_decoder = new MockDecoder(); diff --git a/remoting/host/capturer_mac_unittest.cc b/remoting/host/capturer_mac_unittest.cc index 937d2bd..8305b3a 100644 --- a/remoting/host/capturer_mac_unittest.cc +++ b/remoting/host/capturer_mac_unittest.cc @@ -67,6 +67,8 @@ TEST_F(CapturerMacTest, Capture) { } // namespace remoting +namespace gfx { + std::ostream& operator<<(std::ostream& out, const remoting::InvalidRects& rects) { for (remoting::InvalidRects::const_iterator i = rects.begin(); @@ -76,3 +78,6 @@ std::ostream& operator<<(std::ostream& out, } return out; } + +} // namespace gfx + diff --git a/webkit/glue/web_io_operators.cc b/webkit/glue/web_io_operators.cc index a3d9c0b..9a53212 100644 --- a/webkit/glue/web_io_operators.cc +++ b/webkit/glue/web_io_operators.cc @@ -5,7 +5,9 @@ #include "webkit/glue/web_io_operators.h" #include "gfx/point.h" +#include "gfx/rect.h" #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" +#include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #if defined(WCHAR_T_IS_UTF32) #include "base/string16.h" @@ -24,4 +26,8 @@ std::ostream& operator<<(std::ostream& out, const WebPoint& p) { return out << static_cast<gfx::Point>(p); } +std::ostream& operator<<(std::ostream& out, const WebRect& p) { + return out << static_cast<gfx::Rect>(p); +} + } // namespace WebKit diff --git a/webkit/glue/web_io_operators.h b/webkit/glue/web_io_operators.h index fed5108..e60ef72 100644 --- a/webkit/glue/web_io_operators.h +++ b/webkit/glue/web_io_operators.h @@ -10,6 +10,7 @@ #include "build/build_config.h" namespace WebKit { + #if defined(WCHAR_T_IS_UTF32) class WebString; std::ostream& operator<<(std::ostream& out, const WebString& s); @@ -17,6 +18,10 @@ std::ostream& operator<<(std::ostream& out, const WebString& s); struct WebPoint; std::ostream& operator<<(std::ostream& out, const WebPoint& p); + +struct WebRect; +std::ostream& operator<<(std::ostream& out, const WebRect& p); + } // namespace WebKit #endif // WEBKIT_GLUE_WEB_IO_OPERATORS_H_ |