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

Unified Diff: chrome/browser/extensions/extension_updater_unittest.cc

Issue 196097: Do not send or store cookies for extensions autoupdate http requests.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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/browser/extensions/extension_updater.cc ('k') | chrome/browser/net/url_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_updater_unittest.cc
===================================================================
--- chrome/browser/extensions/extension_updater_unittest.cc (revision 26028)
+++ chrome/browser/extensions/extension_updater_unittest.cc (working copy)
@@ -18,12 +18,14 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "net/base/escape.h"
+#include "net/base/load_flags.h"
#include "net/url_request/url_request_status.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "libxml/globals.h"
+static int expected_load_flags =
+ net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES;
-
// Do-nothing base class for further specialized test classes.
class MockService : public ExtensionUpdateService {
public:
@@ -370,6 +372,7 @@
std::string invalid_xml = "invalid xml";
fetcher = factory.GetFetcherByID(ExtensionUpdater::kManifestFetcherId);
EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL);
+ EXPECT_TRUE(fetcher->load_flags() == expected_load_flags);
fetcher->delegate()->OnURLFetchComplete(
fetcher, url1, URLRequestStatus(), 200, ResponseCookies(),
invalid_xml);
@@ -387,6 +390,7 @@
"</gupdate>";
fetcher = factory.GetFetcherByID(ExtensionUpdater::kManifestFetcherId);
EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL);
+ EXPECT_TRUE(fetcher->load_flags() == expected_load_flags);
fetcher->delegate()->OnURLFetchComplete(
fetcher, url2, URLRequestStatus(), 200, ResponseCookies(),
kValidXml);
@@ -427,6 +431,7 @@
std::string extension_data("whatever");
fetcher = factory.GetFetcherByID(ExtensionUpdater::kExtensionFetcherId);
EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL);
+ EXPECT_TRUE(fetcher->load_flags() == expected_load_flags);
fetcher->delegate()->OnURLFetchComplete(
fetcher, test_url, URLRequestStatus(), 200, ResponseCookies(),
extension_data);
@@ -474,6 +479,7 @@
std::string extension_data("aaabbb");
fetcher = factory.GetFetcherByID(ExtensionUpdater::kExtensionFetcherId);
EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL);
+ EXPECT_TRUE(fetcher->load_flags() == expected_load_flags);
fetcher->delegate()->OnURLFetchComplete(
fetcher, test_url, URLRequestStatus(), 200, ResponseCookies(),
extension_data);
@@ -520,6 +526,7 @@
std::string extension_data1("whatever");
fetcher = factory.GetFetcherByID(ExtensionUpdater::kExtensionFetcherId);
EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL);
+ EXPECT_TRUE(fetcher->load_flags() == expected_load_flags);
fetcher->delegate()->OnURLFetchComplete(
fetcher, url1, URLRequestStatus(), 200, ResponseCookies(),
extension_data1);
@@ -537,6 +544,7 @@
std::string extension_data2("whatever2");
fetcher = factory.GetFetcherByID(ExtensionUpdater::kExtensionFetcherId);
EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL);
+ EXPECT_TRUE(fetcher->load_flags() == expected_load_flags);
fetcher->delegate()->OnURLFetchComplete(
fetcher, url2, URLRequestStatus(), 200, ResponseCookies(),
extension_data2);
« no previous file with comments | « chrome/browser/extensions/extension_updater.cc ('k') | chrome/browser/net/url_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698