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

Unified Diff: chrome/browser/autofill/autofill_download_url_unittest.cc

Issue 11230060: Adding commandline switch and user pref for autofill server url. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changing include after rebasing Created 8 years, 2 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
Index: chrome/browser/autofill/autofill_download_url_unittest.cc
diff --git a/chrome/browser/autofill/autofill_download_url_unittest.cc b/chrome/browser/autofill/autofill_download_url_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f3591d6f00e4cf88870fbdd3975af48769e2fa26
--- /dev/null
+++ b/chrome/browser/autofill/autofill_download_url_unittest.cc
@@ -0,0 +1,48 @@
+// Copyright (c) 2012 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/browser/autofill/autofill_download_url.h"
+#include "chrome/test/base/testing_pref_service.h"
+#include "googleurl/src/gurl.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using testing::HasSubstr;
+using testing::Not;
+
+class AutofillDownloadUrlTest : public testing::Test {
+ public:
+ AutofillDownloadUrlTest() {}
+
+ protected:
+ virtual void SetUp() {
+ pref_service_.reset(new TestingPrefService());
+ }
+
+ scoped_ptr<TestingPrefService> pref_service_;
+};
+
+TEST_F(AutofillDownloadUrlTest, CheckDefaultUrls) {
+ std::string request_url =
+ AutofillDownloadUrl(pref_service_.get()).
+ GetAutofillRequestUrl().spec();
+ EXPECT_THAT(request_url, HasSubstr("clients1.google.com"));
+ EXPECT_THAT(request_url, HasSubstr("/tbproxy/"));
+ EXPECT_THAT(request_url, HasSubstr("/af/"));
+ EXPECT_THAT(request_url, HasSubstr("/query"));
+ EXPECT_THAT(request_url, Not(HasSubstr("/upload")));
+ EXPECT_THAT(request_url, HasSubstr("?client="));
Ilya Sherman 2012/10/25 22:52:02 nit: This does look tidy, but why not just check t
ahutter 2012/10/25 23:56:03 Done.
+
+
Ilya Sherman 2012/10/25 22:52:02 nit: Spurious newline.
ahutter 2012/10/25 23:56:03 Done.
+ std::string upload_url =
+ AutofillDownloadUrl(pref_service_.get()).
+ GetAutofillUploadUrl().spec();
+ EXPECT_THAT(upload_url, HasSubstr("clients1.google.com"));
+ EXPECT_THAT(upload_url, HasSubstr("/tbproxy/"));
+ EXPECT_THAT(upload_url, HasSubstr("/af/"));
+ EXPECT_THAT(upload_url, HasSubstr("/upload"));
+ EXPECT_THAT(upload_url, Not(HasSubstr("/query")));
+ EXPECT_THAT(upload_url, HasSubstr("?client="));
+}
+

Powered by Google App Engine
This is Rietveld 408576698