Chromium Code Reviews| Index: chrome/browser/prefs/pref_service_browsertest.cc |
| diff --git a/chrome/browser/prefs/pref_service_browsertest.cc b/chrome/browser/prefs/pref_service_browsertest.cc |
| index 496af8161c86dac7e2601a20cc08a6f026343b48..aa8e28c68b535c581fe892bfcf5c74c4d44cd939 100644 |
| --- a/chrome/browser/prefs/pref_service_browsertest.cc |
| +++ b/chrome/browser/prefs/pref_service_browsertest.cc |
| @@ -12,6 +12,7 @@ |
| #include "base/test/test_file_util.h" |
| #include "base/values.h" |
| #include "build/build_config.h" |
| +#include "chrome/browser/devtools/devtools_window.h" |
| #include "chrome/browser/ui/browser.h" |
| #include "chrome/browser/ui/browser_window.h" |
| #include "chrome/browser/ui/browser_window_state.h" |
| @@ -227,3 +228,40 @@ IN_PROC_BROWSER_TEST_F(PreservedWindowPlacementIsMigrated, Test) { |
| EXPECT_EQ(is_maximized, is_window_maximized); |
| } |
| #endif |
| + |
| +class AppWindowPlacementIsMigrated : public InProcessBrowserTest { |
| + public: |
| + virtual bool SetUpUserDataDirectory() OVERRIDE { |
| + base::FilePath user_data_directory; |
| + PathService::Get(chrome::DIR_USER_DATA, &user_data_directory); |
| + |
| + base::FilePath original_pref_file = ui_test_utils::GetTestFilePath( |
| + base::FilePath(FILE_PATH_LITERAL("profiles")). |
| + AppendASCII("app_window_placement"). |
| + AppendASCII("Default"), |
| + base::FilePath().Append(chrome::kPreferencesFilename)); |
| + base::FilePath tmp_pref_file = |
| + user_data_directory.AppendASCII(TestingProfile::kTestUserProfileDir); |
| + CHECK(base::CreateDirectory(tmp_pref_file)); |
| + tmp_pref_file = tmp_pref_file.Append(chrome::kPreferencesFilename); |
| + CHECK(base::PathExists(original_pref_file)); |
| + CHECK(base::CopyFile(original_pref_file, tmp_pref_file)); |
|
gab
2014/09/08 21:29:26
s/tmp_pref_file/test_pref_file ? (it's not really
|
| + return true; |
| + } |
| +}; |
| + |
| +IN_PROC_BROWSER_TEST_F(AppWindowPlacementIsMigrated, Test) { |
| + PrefService* prefs = browser()->profile()->GetPrefs(); |
| + const base::DictionaryValue* browser_placement = |
| + prefs->GetDictionary(prefs::kBrowserWindowPlacement); |
| + EXPECT_NE(static_cast<base::DictionaryValue*>(NULL), browser_placement); |
| + |
| + const base::DictionaryValue* app_windows = |
| + prefs->GetDictionary(prefs::kAppWindowPlacement); |
| + EXPECT_NE(static_cast<base::DictionaryValue*>(NULL), browser_placement); |
|
gab
2014/09/08 21:29:25
Also verify that things in this dictionary appear
|
| + const base::DictionaryValue* dev_tools_dict = NULL; |
| + app_windows->GetDictionary(DevToolsWindow::kDevToolsApp, &dev_tools_dict); |
| + int right; |
| + EXPECT_TRUE(dev_tools_dict->GetInteger("right", &right)); |
| + EXPECT_EQ(721, right); |
| +} |
|
gab
2014/09/08 21:29:25
I think you also want to verify that other kBrowse
|