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

Unified Diff: chrome/browser/metrics/variations_service_unittest.cc

Issue 10828255: Revert 150949 - Have the VariationsService attempt to fetch the seed when an update is ready. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/metrics/variations_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/variations_service_unittest.cc
===================================================================
--- chrome/browser/metrics/variations_service_unittest.cc (revision 151030)
+++ chrome/browser/metrics/variations_service_unittest.cc (working copy)
@@ -6,38 +6,15 @@
#include "base/string_split.h"
#include "chrome/browser/metrics/proto/study.pb.h"
#include "chrome/browser/metrics/variations_service.h"
-#include "chrome/browser/upgrade_detector.h"
-#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_pref_service.h"
-#include "content/public/browser/notification_service.h"
-#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace chrome_variations {
namespace {
-// A test class used to validate expected functionality in VariationsService.
-class TestVariationsService : public VariationsService {
- public:
- TestVariationsService() : fetch_attempted_(false) {}
- virtual ~TestVariationsService() {}
-
- bool fetch_attempted() { return fetch_attempted_; }
-
- protected:
- virtual void FetchVariationsSeed() OVERRIDE {
- fetch_attempted_ = true;
- }
-
- private:
- bool fetch_attempted_;
-
- DISALLOW_COPY_AND_ASSIGN(TestVariationsService);
-};
-
// Converts |time| to Study proto format.
int64 TimeToProtoTime(const base::Time& time) {
return (time - base::Time::UnixEpoch()).InSeconds();
@@ -60,21 +37,6 @@
} // namespace
-TEST(VariationsServiceTest, AttemptFetchOnAutoUpdate) {
- // Simulate an auto-update and ensure that the VariationsService attempts
- // to fetch the Variations seed.
- MessageLoopForUI message_loop;
- content::TestBrowserThread ui_thread(content::BrowserThread::UI,
- &message_loop);
- TestVariationsService test_service;
- EXPECT_FALSE(test_service.fetch_attempted());
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
- content::Source<UpgradeDetector>(UpgradeDetector::GetInstance()),
- content::NotificationService::NoDetails());
- EXPECT_TRUE(test_service.fetch_attempted());
-}
-
TEST(VariationsServiceTest, CheckStudyChannel) {
const chrome::VersionInfo::Channel channels[] = {
chrome::VersionInfo::CHANNEL_CANARY,
« no previous file with comments | « chrome/browser/metrics/variations_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698