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

Unified Diff: chrome_frame/test/html_util_unittests.cc

Issue 7922023: Remove webkit_glue::BuildUserAgent(), remove windows spoofing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge to r102225 Created 9 years, 3 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 | « chrome_frame/renderer_glue.cc ('k') | content/common/child_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/html_util_unittests.cc
diff --git a/chrome_frame/test/html_util_unittests.cc b/chrome_frame/test/html_util_unittests.cc
index 9d591066e603a8af5d7fac20b7fd232acd4a8fa3..bf1cc842f151c19790b12469dd4d555a030c1a6d 100644
--- a/chrome_frame/test/html_util_unittests.cc
+++ b/chrome_frame/test/html_util_unittests.cc
@@ -20,11 +20,12 @@
#include "net/base/net_util.h"
#include "chrome/browser/automation/url_request_automation_job.h"
+#include "chrome/common/chrome_version_info.h"
#include "chrome_frame/chrome_frame_automation.h"
#include "chrome_frame/chrome_frame_delegate.h"
#include "chrome_frame/html_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webkit/glue/webkit_glue.h"
+#include "webkit/glue/user_agent.h"
const char kChromeFrameUserAgent[] = "chromeframe";
@@ -403,11 +404,16 @@ TEST_F(HtmlUtilUnittest, GetDefaultUserAgentHeaderWithCFTag) {
}
TEST_F(HtmlUtilUnittest, GetChromeUserAgent) {
- std::string chrome_ua;
- chrome_ua = webkit_glue::BuildUserAgent(false);
- EXPECT_FALSE(chrome_ua.empty());
+
tommi (sloooow) - chröme 2011/09/22 08:58:46 nit: remove empty line
+ // This code is duplicated from chrome_content_client.cc to avoid
+ // introducing a link-time dependency on chrome_common.
+ chrome::VersionInfo version_info;
+ std::string product("Chrome/");
+ product += version_info.is_valid() ? version_info.Version() : "0.0.0.0";
+ std::string chrome_ua = webkit_glue::BuildUserAgentFromProduct(product);
tommi (sloooow) - chröme 2011/09/22 08:58:46 nit: constructor syntax for complex types as is do
+
const char* ua = http_utils::GetChromeUserAgent();
- EXPECT_EQ(0, chrome_ua.compare(ua));
+ EXPECT_EQ(ua, chrome_ua);
}
TEST_F(HtmlUtilUnittest, GetDefaultUserAgent) {
« no previous file with comments | « chrome_frame/renderer_glue.cc ('k') | content/common/child_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698