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

Side by Side Diff: net/proxy/proxy_config_service_linux_unittest.cc

Issue 100453006: Move Touch to base namespace, remove SetLastModifiedTime. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/proxy/proxy_config_service_linux.h" 5 #include "net/proxy/proxy_config_service_linux.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 ProxyConfig config; 1590 ProxyConfig config;
1591 sync_config_getter.SetupAndInitialFetch(); 1591 sync_config_getter.SetupAndInitialFetch();
1592 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, 1592 EXPECT_EQ(ProxyConfigService::CONFIG_VALID,
1593 sync_config_getter.SyncGetLatestProxyConfig(&config)); 1593 sync_config_getter.SyncGetLatestProxyConfig(&config));
1594 EXPECT_TRUE(config.auto_detect()); 1594 EXPECT_TRUE(config.auto_detect());
1595 EXPECT_EQ(GURL(), config.pac_url()); 1595 EXPECT_EQ(GURL(), config.pac_url());
1596 } 1596 }
1597 1597
1598 // Finally, make the .kde4 config directory older than the .kde directory 1598 // Finally, make the .kde4 config directory older than the .kde directory
1599 // and make sure we then use .kde instead of .kde4 since it's newer. 1599 // and make sure we then use .kde instead of .kde4 since it's newer.
1600 file_util::SetLastModifiedTime(kde4_config_, base::Time()); 1600 base::TouchFile(kde4_config_, base::Time(), base::Time());
1601 1601
1602 { SCOPED_TRACE("KDE4, very old .kde4 directory present, use .kde"); 1602 { SCOPED_TRACE("KDE4, very old .kde4 directory present, use .kde");
1603 MockEnvironment* env = new MockEnvironment; 1603 MockEnvironment* env = new MockEnvironment;
1604 env->values.DESKTOP_SESSION = "kde4"; 1604 env->values.DESKTOP_SESSION = "kde4";
1605 env->values.HOME = user_home_.value().c_str(); 1605 env->values.HOME = user_home_.value().c_str();
1606 SynchConfigGetter sync_config_getter( 1606 SynchConfigGetter sync_config_getter(
1607 new ProxyConfigServiceLinux(env)); 1607 new ProxyConfigServiceLinux(env));
1608 ProxyConfig config; 1608 ProxyConfig config;
1609 sync_config_getter.SetupAndInitialFetch(); 1609 sync_config_getter.SetupAndInitialFetch();
1610 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, 1610 EXPECT_EQ(ProxyConfigService::CONFIG_VALID,
1611 sync_config_getter.SyncGetLatestProxyConfig(&config)); 1611 sync_config_getter.SyncGetLatestProxyConfig(&config));
1612 EXPECT_TRUE(config.auto_detect()); 1612 EXPECT_TRUE(config.auto_detect());
1613 EXPECT_EQ(GURL(), config.pac_url()); 1613 EXPECT_EQ(GURL(), config.pac_url());
1614 } 1614 }
1615 } 1615 }
1616 1616
1617 } // namespace net 1617 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698