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

Unified Diff: webkit/glue/webkit_glue_unittest.cc

Issue 10869073: Split user agent code out of the 'glue' target (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to trunk Created 8 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 | « webkit/glue/webkit_glue.gypi ('k') | webkit/glue/webkitplatformsupport_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webkit_glue_unittest.cc
diff --git a/webkit/glue/webkit_glue_unittest.cc b/webkit/glue/webkit_glue_unittest.cc
index f50b20e088cf863ced5a3f96750aafb7ba23b644..3a830cfa044052e502b2049e0cd144b99943b263 100644
--- a/webkit/glue/webkit_glue_unittest.cc
+++ b/webkit/glue/webkit_glue_unittest.cc
@@ -8,12 +8,9 @@
#include "base/message_loop.h"
#include "base/time.h"
-#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/webkitplatformsupport_impl.h"
-#include "webkit/tools/test_shell/test_shell_test.h"
namespace {
@@ -43,51 +40,6 @@ TEST(WebkitGlueTest, DecodeImage) {
image.unlockPixels();
}
-class WebkitGlueUserAgentTest : public TestShellTest {
-};
-
-bool IsSpoofedUserAgent(const std::string& user_agent) {
- return user_agent.find("TestShell") == std::string::npos;
-}
-
-TEST_F(WebkitGlueUserAgentTest, UserAgentSpoofingHack) {
- enum Platform {
- NONE = 0,
- MACOSX = 1,
- WIN = 2,
- OTHER = 4,
- };
-
- struct Expected {
- const char* url;
- int os_mask;
- };
-
- Expected expected[] = {
- { "http://wwww.google.com", NONE },
- { "http://www.microsoft.com/getsilverlight", MACOSX },
- { "http://headlines.yahoo.co.jp/videonews/", MACOSX | WIN },
- { "http://downloads.yahoo.co.jp/docs/silverlight/", MACOSX },
- { "http://gyao.yahoo.co.jp/", MACOSX },
- { "http://weather.yahoo.co.jp/weather/zoomradar/", WIN },
- { "http://promotion.shopping.yahoo.co.jp/", WIN },
- { "http://pokemon.kids.yahoo.co.jp", WIN },
- };
-#if defined(OS_MACOSX)
- int os_bit = MACOSX;
-#elif defined(OS_WIN)
- int os_bit = WIN;
-#else
- int os_bit = OTHER;
-#endif
-
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(expected); ++i) {
- EXPECT_EQ((expected[i].os_mask & os_bit) != 0,
- IsSpoofedUserAgent(
- webkit_glue::GetUserAgent(GURL(expected[i].url))));
- }
-}
-
// Derives WebKitPlatformSupportImpl for testing shared timers.
class TestWebKitPlatformSupport
: public webkit_glue::WebKitPlatformSupportImpl {
« no previous file with comments | « webkit/glue/webkit_glue.gypi ('k') | webkit/glue/webkitplatformsupport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698