OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "apps/app_window.h" | 5 #include "apps/app_window.h" |
6 #include "apps/app_window_registry.h" | 6 #include "apps/app_window_registry.h" |
7 #include "apps/ui/native_app_window.h" | 7 #include "apps/ui/native_app_window.h" |
8 #include "ash/desktop_background/desktop_background_controller.h" | 8 #include "ash/desktop_background/desktop_background_controller.h" |
9 #include "ash/desktop_background/desktop_background_controller_observer.h" | 9 #include "ash/desktop_background/desktop_background_controller_observer.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/chrome_notification_types.h" | 17 #include "chrome/browser/chrome_notification_types.h" |
18 #include "chrome/browser/chromeos/app_mode/fake_cws.h" | |
18 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" | 19 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" |
19 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 20 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
20 #include "chrome/browser/chromeos/login/app_launch_controller.h" | 21 #include "chrome/browser/chromeos/login/app_launch_controller.h" |
21 #include "chrome/browser/chromeos/login/fake_user_manager.h" | 22 #include "chrome/browser/chromeos/login/fake_user_manager.h" |
22 #include "chrome/browser/chromeos/login/mock_user_manager.h" | 23 #include "chrome/browser/chromeos/login/mock_user_manager.h" |
23 #include "chrome/browser/chromeos/login/oobe_base_test.h" | 24 #include "chrome/browser/chromeos/login/oobe_base_test.h" |
24 #include "chrome/browser/chromeos/login/startup_utils.h" | 25 #include "chrome/browser/chromeos/login/startup_utils.h" |
25 #include "chrome/browser/chromeos/login/test/app_window_waiter.h" | 26 #include "chrome/browser/chromeos/login/test/app_window_waiter.h" |
26 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" | 27 #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" |
27 #include "chrome/browser/chromeos/login/wizard_controller.h" | 28 #include "chrome/browser/chromeos/login/wizard_controller.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
38 #include "chrome/common/chrome_paths.h" | 39 #include "chrome/common/chrome_paths.h" |
39 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
40 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
41 #include "chromeos/chromeos_switches.h" | 42 #include "chromeos/chromeos_switches.h" |
42 #include "chromeos/dbus/cryptohome_client.h" | 43 #include "chromeos/dbus/cryptohome_client.h" |
43 #include "components/signin/core/common/signin_pref_names.h" | 44 #include "components/signin/core/common/signin_pref_names.h" |
44 #include "content/public/browser/notification_observer.h" | 45 #include "content/public/browser/notification_observer.h" |
45 #include "content/public/browser/notification_registrar.h" | 46 #include "content/public/browser/notification_registrar.h" |
46 #include "content/public/browser/notification_service.h" | 47 #include "content/public/browser/notification_service.h" |
47 #include "content/public/test/browser_test_utils.h" | 48 #include "content/public/test/browser_test_utils.h" |
48 #include "crypto/sha2.h" | |
49 #include "extensions/browser/extension_system.h" | 49 #include "extensions/browser/extension_system.h" |
50 #include "google_apis/gaia/gaia_constants.h" | 50 #include "google_apis/gaia/gaia_constants.h" |
51 #include "google_apis/gaia/gaia_switches.h" | 51 #include "google_apis/gaia/gaia_switches.h" |
52 #include "google_apis/gaia/gaia_urls.h" | 52 #include "google_apis/gaia/gaia_urls.h" |
53 #include "net/test/embedded_test_server/embedded_test_server.h" | 53 #include "net/test/embedded_test_server/embedded_test_server.h" |
54 #include "net/test/embedded_test_server/http_request.h" | |
55 #include "net/test/embedded_test_server/http_response.h" | |
56 | |
57 using net::test_server::BasicHttpResponse; | |
58 using net::test_server::HttpRequest; | |
59 using net::test_server::HttpResponse; | |
60 | 54 |
61 namespace em = enterprise_management; | 55 namespace em = enterprise_management; |
62 | 56 |
63 namespace chromeos { | 57 namespace chromeos { |
64 | 58 |
65 namespace { | 59 namespace { |
66 | 60 |
67 // This is a simple test app that creates an app window and immediately closes | 61 // This is a simple test app that creates an app window and immediately closes |
68 // it again. Webstore data json is in | 62 // it again. Webstore data json is in |
69 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/ | 63 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/ |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 const std::string js_; | 221 const std::string js_; |
228 scoped_refptr<content::MessageLoopRunner> runner_; | 222 scoped_refptr<content::MessageLoopRunner> runner_; |
229 | 223 |
230 DISALLOW_COPY_AND_ASSIGN(JsConditionWaiter); | 224 DISALLOW_COPY_AND_ASSIGN(JsConditionWaiter); |
231 }; | 225 }; |
232 | 226 |
233 } // namespace | 227 } // namespace |
234 | 228 |
235 class KioskTest : public OobeBaseTest { | 229 class KioskTest : public OobeBaseTest { |
236 public: | 230 public: |
237 KioskTest() { | 231 KioskTest() : fake_cws_(new FakeCWS) { |
238 set_exit_when_last_browser_closes(false); | 232 set_exit_when_last_browser_closes(false); |
239 } | 233 } |
240 | 234 |
241 virtual ~KioskTest() {} | 235 virtual ~KioskTest() {} |
242 | 236 |
243 protected: | 237 protected: |
244 virtual void SetUp() OVERRIDE { | 238 virtual void SetUp() OVERRIDE { |
245 test_app_id_ = kTestKioskApp; | 239 test_app_id_ = kTestKioskApp; |
246 mock_user_manager_.reset(new MockUserManager); | 240 mock_user_manager_.reset(new MockUserManager); |
247 AppLaunchController::SkipSplashWaitForTesting(); | 241 AppLaunchController::SkipSplashWaitForTesting(); |
248 AppLaunchController::SetNetworkWaitForTesting(kTestNetworkTimeoutSeconds); | 242 AppLaunchController::SetNetworkWaitForTesting(kTestNetworkTimeoutSeconds); |
249 | 243 |
250 OobeBaseTest::SetUp(); | 244 OobeBaseTest::SetUp(); |
251 } | 245 } |
252 | 246 |
253 virtual void CleanUpOnMainThread() OVERRIDE { | 247 virtual void CleanUpOnMainThread() OVERRIDE { |
254 AppLaunchController::SetNetworkTimeoutCallbackForTesting(NULL); | 248 AppLaunchController::SetNetworkTimeoutCallbackForTesting(NULL); |
255 AppLaunchSigninScreen::SetUserManagerForTesting(NULL); | 249 AppLaunchSigninScreen::SetUserManagerForTesting(NULL); |
256 | 250 |
257 OobeBaseTest::CleanUpOnMainThread(); | 251 OobeBaseTest::CleanUpOnMainThread(); |
258 | 252 |
259 // Clean up while main thread still runs. | 253 // Clean up while main thread still runs. |
260 // See http://crbug.com/176659. | 254 // See http://crbug.com/176659. |
261 KioskAppManager::Get()->CleanUp(); | 255 KioskAppManager::Get()->CleanUp(); |
262 } | 256 } |
263 | 257 |
264 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 258 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
265 OobeBaseTest::SetUpCommandLine(command_line); | 259 OobeBaseTest::SetUpCommandLine(command_line); |
266 | 260 fake_cws_->Init(embedded_test_server(), |
267 // Create gaia and webstore URL from test server url but using different | 261 false); // Setup update and download urls as well. |
268 // host names. This is to avoid gaia response being tagged as from | |
269 // webstore in chrome_resource_dispatcher_host_delegate.cc. | |
270 GURL webstore_url = GetTestWebstoreUrl(); | |
271 command_line->AppendSwitchASCII( | |
272 ::switches::kAppsGalleryURL, | |
273 webstore_url.Resolve("/chromeos/app_mode/webstore").spec()); | |
274 command_line->AppendSwitchASCII( | |
275 ::switches::kAppsGalleryDownloadURL, | |
276 webstore_url.Resolve( | |
277 "/chromeos/app_mode/webstore/downloads/%s.crx").spec()); | |
278 } | |
279 | |
280 GURL GetTestWebstoreUrl() { | |
281 const GURL& server_url = embedded_test_server()->base_url(); | |
282 std::string webstore_host("webstore"); | |
283 GURL::Replacements replace_webstore_host; | |
284 replace_webstore_host.SetHostStr(webstore_host); | |
285 return server_url.ReplaceComponents(replace_webstore_host); | |
286 } | 262 } |
287 | 263 |
288 void LaunchApp(const std::string& app_id, bool diagnostic_mode) { | 264 void LaunchApp(const std::string& app_id, bool diagnostic_mode) { |
289 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); | 265 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); |
290 GetLoginUI()->CallJavascriptFunction(new_kiosk_ui ? | 266 GetLoginUI()->CallJavascriptFunction(new_kiosk_ui ? |
291 kLaunchAppForTestNewAPI : kLaunchAppForTestOldAPI, | 267 kLaunchAppForTestNewAPI : kLaunchAppForTestOldAPI, |
292 base::StringValue(app_id), | 268 base::StringValue(app_id), |
293 base::FundamentalValue(diagnostic_mode)); | 269 base::FundamentalValue(diagnostic_mode)); |
294 } | 270 } |
295 | 271 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
528 ->GetAppLaunchController(); | 504 ->GetAppLaunchController(); |
529 } | 505 } |
530 | 506 |
531 MockUserManager* mock_user_manager() { return mock_user_manager_.get(); } | 507 MockUserManager* mock_user_manager() { return mock_user_manager_.get(); } |
532 | 508 |
533 void set_test_app_id(const std::string& test_app_id) { | 509 void set_test_app_id(const std::string& test_app_id) { |
534 test_app_id_ = test_app_id; | 510 test_app_id_ = test_app_id; |
535 } | 511 } |
536 const std::string& test_app_id() const { return test_app_id_; } | 512 const std::string& test_app_id() const { return test_app_id_; } |
537 | 513 |
514 protected: | |
515 scoped_ptr<FakeCWS> fake_cws_; | |
xiyuan
2014/05/13 16:43:35
Member variable should be listed last. In this cas
jennyz
2014/05/13 18:36:11
Done.
| |
516 FakeCWS* fake_cws() { return fake_cws_.get(); } | |
517 | |
538 private: | 518 private: |
539 std::string test_app_id_; | 519 std::string test_app_id_; |
540 scoped_ptr<MockUserManager> mock_user_manager_; | 520 scoped_ptr<MockUserManager> mock_user_manager_; |
541 | 521 |
542 DISALLOW_COPY_AND_ASSIGN(KioskTest); | 522 DISALLOW_COPY_AND_ASSIGN(KioskTest); |
543 }; | 523 }; |
544 | 524 |
545 IN_PROC_BROWSER_TEST_F(KioskTest, InstallAndLaunchApp) { | 525 IN_PROC_BROWSER_TEST_F(KioskTest, InstallAndLaunchApp) { |
546 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 526 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
547 WaitForAppLaunchSuccess(); | 527 WaitForAppLaunchSuccess(); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
910 // Needs background networking so that ExtensionDownloader works. | 890 // Needs background networking so that ExtensionDownloader works. |
911 needs_background_networking_ = true; | 891 needs_background_networking_ = true; |
912 | 892 |
913 KioskTest::SetUpCommandLine(command_line); | 893 KioskTest::SetUpCommandLine(command_line); |
914 if (GetParam()) | 894 if (GetParam()) |
915 command_line->AppendSwitch(::switches::kMultiProfiles); | 895 command_line->AppendSwitch(::switches::kMultiProfiles); |
916 } | 896 } |
917 | 897 |
918 virtual void SetUpOnMainThread() OVERRIDE { | 898 virtual void SetUpOnMainThread() OVERRIDE { |
919 KioskTest::SetUpOnMainThread(); | 899 KioskTest::SetUpOnMainThread(); |
920 | |
921 GURL webstore_url = GetTestWebstoreUrl(); | |
922 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | |
923 ::switches::kAppsGalleryUpdateURL, | |
924 webstore_url.Resolve("/update_check.xml").spec()); | |
925 | |
926 embedded_test_server()->RegisterRequestHandler( | |
927 base::Bind(&KioskUpdateTest::HandleRequest, | |
928 base::Unretained(this))); | |
929 } | |
930 | |
931 void SetNoUpdate() { | |
932 SetUpdateCheckContent( | |
933 "chromeos/app_mode/webstore/update_check/no_update.xml", | |
934 GURL(), | |
935 "", | |
936 "", | |
937 ""); | |
938 } | |
939 | |
940 void SetUpdateCrx(const std::string& crx_file, const std::string& version) { | |
941 GURL webstore_url = GetTestWebstoreUrl(); | |
942 GURL crx_download_url = webstore_url.Resolve( | |
943 "/chromeos/app_mode/webstore/downloads/" + crx_file); | |
944 base::FilePath test_data_dir; | |
945 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); | |
946 base::FilePath crx_file_path = | |
947 test_data_dir.AppendASCII("chromeos/app_mode/webstore/downloads") | |
948 .AppendASCII(crx_file); | |
949 | |
950 std::string crx_content; | |
951 ASSERT_TRUE(base::ReadFileToString(crx_file_path, &crx_content)); | |
952 | |
953 const std::string sha256 = crypto::SHA256HashString(crx_content); | |
954 const std::string sha256_hex = | |
955 base::HexEncode(sha256.c_str(), sha256.size()); | |
956 | |
957 SetUpdateCheckContent( | |
958 "chromeos/app_mode/webstore/update_check/has_update.xml", | |
959 crx_download_url, | |
960 sha256_hex, | |
961 base::UintToString(crx_content.size()), | |
962 version); | |
963 } | 900 } |
964 | 901 |
965 private: | 902 private: |
966 void SetUpdateCheckContent(const std::string& update_check_file, | |
967 const GURL& crx_download_url, | |
968 const std::string& crx_fp, | |
969 const std::string& crx_size, | |
970 const std::string& version) { | |
971 base::FilePath test_data_dir; | |
972 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); | |
973 base::FilePath update_file = | |
974 test_data_dir.AppendASCII(update_check_file.c_str()); | |
975 ASSERT_TRUE(base::ReadFileToString(update_file, &update_check_content_)); | |
976 | |
977 ReplaceSubstringsAfterOffset( | |
978 &update_check_content_, 0, "$AppId", test_app_id()); | |
979 ReplaceSubstringsAfterOffset( | |
980 &update_check_content_, 0, "$CrxDownloadUrl", crx_download_url.spec()); | |
981 ReplaceSubstringsAfterOffset(&update_check_content_, 0, "$FP", crx_fp); | |
982 ReplaceSubstringsAfterOffset(&update_check_content_, 0, "$Size", crx_size); | |
983 ReplaceSubstringsAfterOffset( | |
984 &update_check_content_, 0, "$Version", version); | |
985 } | |
986 | |
987 scoped_ptr<HttpResponse> HandleRequest(const HttpRequest& request) { | |
988 GURL request_url = GURL("http://localhost").Resolve(request.relative_url); | |
989 std::string request_path = request_url.path(); | |
990 if (!update_check_content_.empty() && | |
991 request_path == "/update_check.xml") { | |
992 scoped_ptr<BasicHttpResponse> http_response(new BasicHttpResponse()); | |
993 http_response->set_code(net::HTTP_OK); | |
994 http_response->set_content_type("text/xml"); | |
995 http_response->set_content(update_check_content_); | |
996 return http_response.PassAs<HttpResponse>(); | |
997 } | |
998 | |
999 return scoped_ptr<HttpResponse>(); | |
1000 } | |
1001 | |
1002 std::string update_check_content_; | |
1003 | 903 |
1004 DISALLOW_COPY_AND_ASSIGN(KioskUpdateTest); | 904 DISALLOW_COPY_AND_ASSIGN(KioskUpdateTest); |
1005 }; | 905 }; |
1006 | 906 |
1007 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, LaunchOfflineEnabledAppNoNetwork) { | 907 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, LaunchOfflineEnabledAppNoNetwork) { |
1008 set_test_app_id(kTestOfflineEnabledKioskApp); | 908 set_test_app_id(kTestOfflineEnabledKioskApp); |
1009 | 909 |
1010 PrepareAppLaunch(); | 910 PrepareAppLaunch(); |
1011 SimulateNetworkOffline(); | 911 SimulateNetworkOffline(); |
1012 SetupAppProfile("chromeos/app_mode/offline_enabled_app_profile"); | 912 SetupAppProfile("chromeos/app_mode/offline_enabled_app_profile"); |
1013 | 913 |
1014 LaunchApp(test_app_id(), false); | 914 LaunchApp(test_app_id(), false); |
1015 WaitForAppLaunchSuccess(); | 915 WaitForAppLaunchSuccess(); |
1016 } | 916 } |
1017 | 917 |
1018 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, LaunchOfflineEnabledAppNoUpdate) { | 918 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, LaunchOfflineEnabledAppNoUpdate) { |
1019 set_test_app_id(kTestOfflineEnabledKioskApp); | 919 set_test_app_id(kTestOfflineEnabledKioskApp); |
1020 | 920 |
1021 SetNoUpdate(); | 921 fake_cws()->SetNoUpdate(test_app_id()); |
1022 | 922 |
1023 PrepareAppLaunch(); | 923 PrepareAppLaunch(); |
1024 SimulateNetworkOnline(); | 924 SimulateNetworkOnline(); |
1025 SetupAppProfile("chromeos/app_mode/offline_enabled_app_profile"); | 925 SetupAppProfile("chromeos/app_mode/offline_enabled_app_profile"); |
1026 | 926 |
1027 LaunchApp(test_app_id(), false); | 927 LaunchApp(test_app_id(), false); |
1028 WaitForAppLaunchSuccess(); | 928 WaitForAppLaunchSuccess(); |
1029 | 929 |
1030 EXPECT_EQ("1.0.0", GetInstalledAppVersion().GetString()); | 930 EXPECT_EQ("1.0.0", GetInstalledAppVersion().GetString()); |
1031 } | 931 } |
1032 | 932 |
1033 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, LaunchOfflineEnabledAppHasUpdate) { | 933 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, LaunchOfflineEnabledAppHasUpdate) { |
1034 set_test_app_id(kTestOfflineEnabledKioskApp); | 934 set_test_app_id(kTestOfflineEnabledKioskApp); |
1035 | 935 |
1036 SetUpdateCrx("ajoggoflpgplnnjkjamcmbepjdjdnpdp.crx", "2.0.0"); | 936 fake_cws()->SetUpdateCrx( |
937 test_app_id(), "ajoggoflpgplnnjkjamcmbepjdjdnpdp.crx", "2.0.0"); | |
1037 | 938 |
1038 PrepareAppLaunch(); | 939 PrepareAppLaunch(); |
1039 SimulateNetworkOnline(); | 940 SimulateNetworkOnline(); |
1040 SetupAppProfile("chromeos/app_mode/offline_enabled_app_profile"); | 941 SetupAppProfile("chromeos/app_mode/offline_enabled_app_profile"); |
1041 | 942 |
1042 LaunchApp(test_app_id(), false); | 943 LaunchApp(test_app_id(), false); |
1043 WaitForAppLaunchSuccess(); | 944 WaitForAppLaunchSuccess(); |
1044 | 945 |
1045 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); | 946 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); |
1046 } | 947 } |
1047 | 948 |
1048 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, PermissionChange) { | 949 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, PermissionChange) { |
1049 set_test_app_id(kTestOfflineEnabledKioskApp); | 950 set_test_app_id(kTestOfflineEnabledKioskApp); |
1050 | 951 |
1051 SetUpdateCrx("ajoggoflpgplnnjkjamcmbepjdjdnpdp_v2_permission_change.crx", | 952 fake_cws()->SetUpdateCrx( |
1052 "2.0.0"); | 953 test_app_id(), |
954 "ajoggoflpgplnnjkjamcmbepjdjdnpdp_v2_permission_change.crx", | |
955 "2.0.0"); | |
1053 | 956 |
1054 PrepareAppLaunch(); | 957 PrepareAppLaunch(); |
1055 SimulateNetworkOnline(); | 958 SimulateNetworkOnline(); |
1056 SetupAppProfile("chromeos/app_mode/offline_enabled_app_profile"); | 959 SetupAppProfile("chromeos/app_mode/offline_enabled_app_profile"); |
1057 | 960 |
1058 LaunchApp(test_app_id(), false); | 961 LaunchApp(test_app_id(), false); |
1059 WaitForAppLaunchSuccess(); | 962 WaitForAppLaunchSuccess(); |
1060 | 963 |
1061 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); | 964 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); |
1062 } | 965 } |
1063 | 966 |
1064 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, PRE_PreserveLocalData) { | 967 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, PRE_PreserveLocalData) { |
1065 // Installs v1 app and writes some local data. | 968 // Installs v1 app and writes some local data. |
1066 set_test_app_id(kTestLocalFsKioskApp); | 969 set_test_app_id(kTestLocalFsKioskApp); |
1067 | 970 |
1068 ResultCatcher catcher; | 971 ResultCatcher catcher; |
1069 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 972 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
1070 WaitForAppLaunchSuccess(); | 973 WaitForAppLaunchSuccess(); |
1071 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 974 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
1072 } | 975 } |
1073 | 976 |
1074 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, PreserveLocalData) { | 977 IN_PROC_BROWSER_TEST_P(KioskUpdateTest, PreserveLocalData) { |
1075 // Update existing v1 app installed in PRE_PreserveLocalData to v2 | 978 // Update existing v1 app installed in PRE_PreserveLocalData to v2 |
1076 // that reads and verifies the local data. | 979 // that reads and verifies the local data. |
1077 set_test_app_id(kTestLocalFsKioskApp); | 980 set_test_app_id(kTestLocalFsKioskApp); |
1078 | 981 |
1079 SetUpdateCrx("bmbpicmpniaclbbpdkfglgipkkebnbjf_v2_read_and_verify_data.crx", | 982 fake_cws()->SetUpdateCrx( |
1080 "2.0.0"); | 983 test_app_id(), |
984 "bmbpicmpniaclbbpdkfglgipkkebnbjf_v2_read_and_verify_data.crx", | |
985 "2.0.0"); | |
1081 | 986 |
1082 ResultCatcher catcher; | 987 ResultCatcher catcher; |
1083 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 988 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
1084 WaitForAppLaunchSuccess(); | 989 WaitForAppLaunchSuccess(); |
1085 | 990 |
1086 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); | 991 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); |
1087 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 992 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
1088 } | 993 } |
1089 | 994 |
1090 // TODO(xiyuan): Remove this after multi profile is turned on by default. | 995 // TODO(xiyuan): Remove this after multi profile is turned on by default. |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1300 content::WindowedNotificationObserver( | 1205 content::WindowedNotificationObserver( |
1301 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1206 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1302 content::NotificationService::AllSources()).Wait(); | 1207 content::NotificationService::AllSources()).Wait(); |
1303 | 1208 |
1304 // Wait for the wallpaper to load. | 1209 // Wait for the wallpaper to load. |
1305 WaitForWallpaper(); | 1210 WaitForWallpaper(); |
1306 EXPECT_TRUE(wallpaper_loaded()); | 1211 EXPECT_TRUE(wallpaper_loaded()); |
1307 } | 1212 } |
1308 | 1213 |
1309 } // namespace chromeos | 1214 } // namespace chromeos |
OLD | NEW |