| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/test_file_util.h" |
| 9 #include "base/values.h" | 10 #include "base/values.h" |
| 10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 11 #include "chrome/common/chrome_constants.h" | 12 #include "chrome/common/chrome_constants.h" |
| 12 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/common/json_value_serializer.h" | 14 #include "chrome/common/json_value_serializer.h" |
| 14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 15 #include "chrome/test/automation/browser_proxy.h" | 16 #include "chrome/test/automation/browser_proxy.h" |
| 16 #include "chrome/test/automation/window_proxy.h" | 17 #include "chrome/test/automation/window_proxy.h" |
| 17 #include "chrome/test/ui/ui_test.h" | 18 #include "chrome/test/ui/ui_test.h" |
| 18 | 19 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 bool LaunchAppWithProfile() { | 54 bool LaunchAppWithProfile() { |
| 54 if (!file_util::PathExists(tmp_pref_file_)) | 55 if (!file_util::PathExists(tmp_pref_file_)) |
| 55 return false; | 56 return false; |
| 56 UITest::SetUp(); | 57 UITest::SetUp(); |
| 57 return true; | 58 return true; |
| 58 } | 59 } |
| 59 | 60 |
| 60 void TearDown() { | 61 void TearDown() { |
| 61 UITest::TearDown(); | 62 UITest::TearDown(); |
| 62 | 63 |
| 63 EXPECT_TRUE(DieFileDie(tmp_profile_, true)); | 64 EXPECT_TRUE(file_util::DieFileDie(tmp_profile_, true)); |
| 64 } | 65 } |
| 65 | 66 |
| 66 public: | 67 public: |
| 67 FilePath tmp_pref_file_; | 68 FilePath tmp_pref_file_; |
| 68 FilePath tmp_profile_; | 69 FilePath tmp_profile_; |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 #if defined(OS_WIN) | 72 #if defined(OS_WIN) |
| 72 // This test verifies that the window position from the prefs file is restored | 73 // This test verifies that the window position from the prefs file is restored |
| 73 // when the app restores. This doesn't really make sense on Linux, where | 74 // when the app restores. This doesn't really make sense on Linux, where |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 126 |
| 126 // Find if launched window is maximized | 127 // Find if launched window is maximized |
| 127 bool is_window_maximized = (window_placement.showCmd == SW_MAXIMIZE); | 128 bool is_window_maximized = (window_placement.showCmd == SW_MAXIMIZE); |
| 128 | 129 |
| 129 bool is_maximized = false; | 130 bool is_maximized = false; |
| 130 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + L".maximized", | 131 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + L".maximized", |
| 131 &is_maximized)); | 132 &is_maximized)); |
| 132 EXPECT_EQ(is_maximized, is_window_maximized); | 133 EXPECT_EQ(is_maximized, is_window_maximized); |
| 133 } | 134 } |
| 134 #endif | 135 #endif |
| OLD | NEW |