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

Unified Diff: chrome/test/webdriver/http_response_unittest.cc

Issue 23526047: Delete old chromedriver code, and remove mongoose webserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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/test/webdriver/http_response.cc ('k') | chrome/test/webdriver/keycode_text_conversion.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/webdriver/http_response_unittest.cc
diff --git a/chrome/test/webdriver/http_response_unittest.cc b/chrome/test/webdriver/http_response_unittest.cc
deleted file mode 100644
index 4e204c6a92e6a471b9b57ee449de7d63c38b6f44..0000000000000000000000000000000000000000
--- a/chrome/test/webdriver/http_response_unittest.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/test/webdriver/http_response.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace webdriver {
-
-namespace {
-
-void ExpectHeaderValue(const HttpResponse& response, const std::string& name,
- const std::string& expected_value) {
- std::string actual_value;
- EXPECT_TRUE(response.GetHeader(name, &actual_value));
- EXPECT_EQ(expected_value, actual_value);
-}
-
-} // namespace
-
-TEST(HttpResponseTest, AddingHeaders) {
- HttpResponse response;
-
- response.AddHeader("FOO", "a");
- ExpectHeaderValue(response, "foo", "a");
-
- // Headers should be case insensitive.
- response.AddHeader("fOo", "b,c");
- response.AddHeader("FoO", "d");
- ExpectHeaderValue(response, "foo", "a,b,c,d");
-}
-
-TEST(HttpResponseTest, RemovingHeaders) {
- HttpResponse response;
-
- ASSERT_FALSE(response.RemoveHeader("I-Am-Not-There"));
-
- ASSERT_FALSE(response.GetHeader("foo", NULL));
- response.AddHeader("foo", "bar");
- ASSERT_TRUE(response.GetHeader("foo", NULL));
- ASSERT_TRUE(response.RemoveHeader("foo"));
- ASSERT_FALSE(response.GetHeader("foo", NULL));
-}
-
-TEST(HttpResponseTest, CanClearAllHeaders) {
- HttpResponse response;
- response.AddHeader("food", "cheese");
- response.AddHeader("color", "red");
-
- ExpectHeaderValue(response, "food", "cheese");
- ExpectHeaderValue(response, "color", "red");
-
- response.ClearHeaders();
- EXPECT_FALSE(response.GetHeader("food", NULL));
- EXPECT_FALSE(response.GetHeader("color", NULL));
-}
-
-TEST(HttpResponseTest, CanSetMimeType) {
- HttpResponse response;
-
- response.SetMimeType("application/json");
- ExpectHeaderValue(response, "content-type", "application/json");
-
- response.SetMimeType("text/html");
- ExpectHeaderValue(response, "content-type", "text/html");
-}
-
-TEST(HttpResponseTest, GetData) {
- HttpResponse response;
- response.set_body("my body");
- std::string data;
- response.GetData(&data);
- const char* expected =
- "HTTP/1.1 200 OK\r\n"
- "content-length:7\r\n"
- "\r\n"
- "my body";
- ASSERT_STREQ(expected, data.c_str());
-}
-
-} // namespace webdriver
« no previous file with comments | « chrome/test/webdriver/http_response.cc ('k') | chrome/test/webdriver/keycode_text_conversion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698