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

Unified Diff: chrome/browser/geolocation/geolocation_browsertest.cc

Issue 1411653004: Remove last usage functions from HostContentSettingsMap Base URL: https://chromium.googlesource.com/chromium/src.git@simplify-host-content-settings
Patch Set: Created 5 years, 1 month 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/geolocation/geolocation_browsertest.cc
diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc
index c8ff648f1ff6e799fbe8808e815cb71beb671fe9..31ea783d4b1637e54f11690cdc61f48c20eb6748 100644
--- a/chrome/browser/geolocation/geolocation_browsertest.cc
+++ b/chrome/browser/geolocation/geolocation_browsertest.cc
@@ -728,43 +728,3 @@ IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, TabDestroyed) {
ASSERT_TRUE(content::ExecuteScript(
current_browser()->tab_strip_model()->GetActiveWebContents(), script));
}
-
-#if defined(OS_LINUX)
-// http://crbug.com/527437
-#define MAYBE_LastUsageUpdated DISABLED_LastUsageUpdated
-#else
-#define MAYBE_LastUsageUpdated LastUsageUpdated
-#endif
-IN_PROC_BROWSER_TEST_F(GeolocationBrowserTest, MAYBE_LastUsageUpdated) {
- ASSERT_NO_FATAL_FAILURE(Initialize(INITIALIZATION_DEFAULT));
- base::SimpleTestClock* clock_ = new base::SimpleTestClock();
- GetHostContentSettingsMap()->SetPrefClockForTesting(
- scoped_ptr<base::Clock>(clock_));
- clock_->SetNow(base::Time::UnixEpoch() + base::TimeDelta::FromSeconds(10));
-
- // Setting the permission should trigger the last usage.
- GetHostContentSettingsMap()->SetContentSetting(
- ContentSettingsPattern::FromURLNoWildcard(current_url()),
- ContentSettingsPattern::FromURLNoWildcard(current_url()),
- CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(),
- CONTENT_SETTING_ALLOW);
-
- // Permission has been used at the starting time.
- EXPECT_EQ(GetHostContentSettingsMap()->GetLastUsage(
- current_url().GetOrigin(),
- current_url().GetOrigin(),
- CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), 10);
-
- clock_->Advance(base::TimeDelta::FromSeconds(3));
-
- // Calling watchPosition should trigger the last usage update.
- WatchPositionAndObservePermissionBubble(false);
- ExpectPosition(fake_latitude(), fake_longitude());
-
- // Last usage has been updated.
- EXPECT_EQ(GetHostContentSettingsMap()->GetLastUsage(
- current_url().GetOrigin(),
- current_url().GetOrigin(),
- CONTENT_SETTINGS_TYPE_GEOLOCATION).ToDoubleT(), 13);
-}

Powered by Google App Engine
This is Rietveld 408576698