[shill] Save profile specific data
BUG=chromium-os:17253
TEST=unit
Change-Id: I1ae28e1f42f4c0bf132cb28df9f334dfa1ca6795
Reviewed-on: http://gerrit.chromium.org/gerrit/7831
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/default_profile_unittest.cc b/default_profile_unittest.cc
index 5fb188e..e819185 100644
--- a/default_profile_unittest.cc
+++ b/default_profile_unittest.cc
@@ -13,11 +13,13 @@
#include "shill/manager.h"
#include "shill/mock_control.h"
+#include "shill/mock_store.h"
#include "shill/property_store_unittest.h"
using std::map;
using std::string;
using ::testing::_;
+using ::testing::Return;
namespace shill {
@@ -67,6 +69,23 @@
}
}
+TEST_F(DefaultProfileTest, Save) {
+ MockStore storage;
+ EXPECT_CALL(storage, SetString(DefaultProfile::kStorageId,
+ DefaultProfile::kStorageName,
+ DefaultProfile::kDefaultId))
+ .WillOnce(Return(true));
+ EXPECT_CALL(storage, SetString(DefaultProfile::kStorageId,
+ DefaultProfile::kStorageCheckPortalList,
+ ""))
+ .WillOnce(Return(true));
+ EXPECT_CALL(storage, SetBool(DefaultProfile::kStorageId,
+ DefaultProfile::kStorageOfflineMode,
+ false))
+ .WillOnce(Return(true));
+ ASSERT_TRUE(profile_->Save(&storage));
+}
+
TEST_F(DefaultProfileTest, GetStoragePath) {
FilePath path;
EXPECT_TRUE(profile_->GetStoragePath(&path));