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

Side by Side Diff: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc

Issue 398753004: [cros] Move User class to user_manager component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 5 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
6 6
7 #include "ash/desktop_background/desktop_background_controller.h" 7 #include "ash/desktop_background/desktop_background_controller.h"
8 #include "ash/desktop_background/desktop_background_controller_observer.h" 8 #include "ash/desktop_background/desktop_background_controller_observer.h"
9 #include "ash/desktop_background/desktop_background_controller_test_api.h" 9 #include "ash/desktop_background/desktop_background_controller_test_api.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/test/ash_test_base.h" 12 #include "ash/test/ash_test_base.h"
13 #include "ash/test/ash_test_helper.h" 13 #include "ash/test/ash_test_helper.h"
14 #include "ash/test/display_manager_test_api.h" 14 #include "ash/test/display_manager_test_api.h"
15 #include "ash/test/test_user_wallpaper_delegate.h" 15 #include "ash/test/test_user_wallpaper_delegate.h"
16 #include "base/command_line.h" 16 #include "base/command_line.h"
17 #include "base/compiler_specific.h" 17 #include "base/compiler_specific.h"
18 #include "base/file_util.h" 18 #include "base/file_util.h"
19 #include "base/files/file_path.h" 19 #include "base/files/file_path.h"
20 #include "base/macros.h" 20 #include "base/macros.h"
21 #include "base/message_loop/message_loop.h" 21 #include "base/message_loop/message_loop.h"
22 #include "base/path_service.h" 22 #include "base/path_service.h"
23 #include "base/prefs/scoped_user_pref_update.h" 23 #include "base/prefs/scoped_user_pref_update.h"
24 #include "base/strings/string_number_conversions.h" 24 #include "base/strings/string_number_conversions.h"
25 #include "base/time/time.h" 25 #include "base/time/time.h"
26 #include "base/values.h" 26 #include "base/values.h"
27 #include "chrome/browser/chromeos/login/users/user.h"
28 #include "chrome/browser/chromeos/login/users/user_manager.h" 27 #include "chrome/browser/chromeos/login/users/user_manager.h"
29 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_test_u tils.h" 28 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_test_u tils.h"
30 #include "chrome/common/chrome_paths.h" 29 #include "chrome/common/chrome_paths.h"
31 #include "chrome/test/base/in_process_browser_test.h" 30 #include "chrome/test/base/in_process_browser_test.h"
32 #include "chrome/test/base/testing_browser_process.h" 31 #include "chrome/test/base/testing_browser_process.h"
33 #include "chromeos/chromeos_switches.h" 32 #include "chromeos/chromeos_switches.h"
34 #include "chromeos/login/user_names.h" 33 #include "chromeos/login/user_names.h"
34 #include "components/user_manager/user.h"
35 #include "content/public/test/test_utils.h" 35 #include "content/public/test/test_utils.h"
36 #include "ui/aura/env.h" 36 #include "ui/aura/env.h"
37 #include "ui/gfx/image/image_skia.h" 37 #include "ui/gfx/image/image_skia.h"
38 #include "ui/gfx/point.h" 38 #include "ui/gfx/point.h"
39 #include "ui/gfx/rect.h" 39 #include "ui/gfx/rect.h"
40 40
41 using namespace ash; 41 using namespace ash;
42 42
43 namespace chromeos { 43 namespace chromeos {
44 44
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 kSmallWallpaperHeight, 170 kSmallWallpaperHeight,
171 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor)); 171 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
172 ASSERT_TRUE(wallpaper_manager_test_utils::WriteJPEGFile( 172 ASSERT_TRUE(wallpaper_manager_test_utils::WriteJPEGFile(
173 large_wallpaper_path, 173 large_wallpaper_path,
174 kLargeWallpaperWidth, 174 kLargeWallpaperWidth,
175 kLargeWallpaperHeight, 175 kLargeWallpaperHeight,
176 wallpaper_manager_test_utils::kLargeDefaultWallpaperColor)); 176 wallpaper_manager_test_utils::kLargeDefaultWallpaperColor));
177 177
178 std::string relative_path = base::FilePath(kTestUser1Hash).Append(id).value(); 178 std::string relative_path = base::FilePath(kTestUser1Hash).Append(id).value();
179 // Saves wallpaper info to local state for user |kTestUser1|. 179 // Saves wallpaper info to local state for user |kTestUser1|.
180 WallpaperInfo info = { 180 WallpaperInfo info = {relative_path, WALLPAPER_LAYOUT_CENTER_CROPPED,
181 relative_path, 181 user_manager::User::CUSTOMIZED,
182 WALLPAPER_LAYOUT_CENTER_CROPPED, 182 base::Time::Now().LocalMidnight()};
183 User::CUSTOMIZED,
184 base::Time::Now().LocalMidnight()
185 };
186 wallpaper_manager->SetUserWallpaperInfo(kTestUser1, info, true); 183 wallpaper_manager->SetUserWallpaperInfo(kTestUser1, info, true);
187 184
188 // Set the wallpaper for |kTestUser1|. 185 // Set the wallpaper for |kTestUser1|.
189 wallpaper_manager->SetUserWallpaperNow(kTestUser1); 186 wallpaper_manager->SetUserWallpaperNow(kTestUser1);
190 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 187 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
191 gfx::ImageSkia wallpaper = controller_->GetWallpaper(); 188 gfx::ImageSkia wallpaper = controller_->GetWallpaper();
192 189
193 // Display is initialized to 800x600. The small resolution custom wallpaper is 190 // Display is initialized to 800x600. The small resolution custom wallpaper is
194 // expected. 191 // expected.
195 EXPECT_EQ(kSmallWallpaperWidth, wallpaper.width()); 192 EXPECT_EQ(kSmallWallpaperWidth, wallpaper.width());
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 kTestUser1Hash, 252 kTestUser1Hash,
256 id); 253 id);
257 ASSERT_TRUE(wallpaper_manager_test_utils::WriteJPEGFile( 254 ASSERT_TRUE(wallpaper_manager_test_utils::WriteJPEGFile(
258 small_wallpaper_path, 255 small_wallpaper_path,
259 kSmallWallpaperWidth, 256 kSmallWallpaperWidth,
260 kSmallWallpaperHeight, 257 kSmallWallpaperHeight,
261 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor)); 258 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
262 259
263 std::string relative_path = base::FilePath(kTestUser1Hash).Append(id).value(); 260 std::string relative_path = base::FilePath(kTestUser1Hash).Append(id).value();
264 // Saves wallpaper info to local state for user |kTestUser1|. 261 // Saves wallpaper info to local state for user |kTestUser1|.
265 WallpaperInfo info = { 262 WallpaperInfo info = {relative_path, WALLPAPER_LAYOUT_CENTER_CROPPED,
266 relative_path, 263 user_manager::User::CUSTOMIZED,
267 WALLPAPER_LAYOUT_CENTER_CROPPED, 264 base::Time::Now().LocalMidnight()};
268 User::CUSTOMIZED,
269 base::Time::Now().LocalMidnight()
270 };
271 wallpaper_manager->SetUserWallpaperInfo(kTestUser1, info, true); 265 wallpaper_manager->SetUserWallpaperInfo(kTestUser1, info, true);
272 266
273 wallpaper_manager->SetUserWallpaperNow(kTestUser1); 267 wallpaper_manager->SetUserWallpaperNow(kTestUser1);
274 WaitAsyncWallpaperLoadStarted(); 268 WaitAsyncWallpaperLoadStarted();
275 EXPECT_EQ(2, LoadedWallpapers()); 269 EXPECT_EQ(2, LoadedWallpapers());
276 // Loads the same wallpaper before the initial one finished. It should be 270 // Loads the same wallpaper before the initial one finished. It should be
277 // prevented. 271 // prevented.
278 wallpaper_manager->SetUserWallpaperNow(kTestUser1); 272 wallpaper_manager->SetUserWallpaperNow(kTestUser1);
279 WaitAsyncWallpaperLoadStarted(); 273 WaitAsyncWallpaperLoadStarted();
280 EXPECT_EQ(2, LoadedWallpapers()); 274 EXPECT_EQ(2, LoadedWallpapers());
281 wallpaper_manager->SetUserWallpaperNow(kTestUser1); 275 wallpaper_manager->SetUserWallpaperNow(kTestUser1);
282 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 276 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
283 EXPECT_EQ(2, LoadedWallpapers()); 277 EXPECT_EQ(2, LoadedWallpapers());
284 } 278 }
285 279
286 // Some users have old user profiles which may have legacy wallpapers. And these 280 // Some users have old user profiles which may have legacy wallpapers. And these
287 // lagacy wallpapers should migrate to new wallpaper picker version seamlessly. 281 // lagacy wallpapers should migrate to new wallpaper picker version seamlessly.
288 // This tests make sure we compatible with migrated old wallpapers. 282 // This tests make sure we compatible with migrated old wallpapers.
289 // crosbug.com/38429 283 // crosbug.com/38429
290 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, 284 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
291 PRE_UseMigratedWallpaperInfo) { 285 PRE_UseMigratedWallpaperInfo) {
292 // New user log in, a default wallpaper is loaded. 286 // New user log in, a default wallpaper is loaded.
293 LogIn(kTestUser1, kTestUser1Hash); 287 LogIn(kTestUser1, kTestUser1Hash);
294 // Old wallpaper migration code doesn't exist in codebase anymore. Modify user 288 // Old wallpaper migration code doesn't exist in codebase anymore. Modify user
295 // wallpaper info directly to simulate the wallpaper migration. See 289 // wallpaper info directly to simulate the wallpaper migration. See
296 // crosbug.com/38429 for details about why we modify wallpaper info this way. 290 // crosbug.com/38429 for details about why we modify wallpaper info this way.
297 WallpaperInfo info = { 291 WallpaperInfo info = {"123", WALLPAPER_LAYOUT_CENTER_CROPPED,
298 "123", 292 user_manager::User::DEFAULT,
299 WALLPAPER_LAYOUT_CENTER_CROPPED, 293 base::Time::Now().LocalMidnight()};
300 User::DEFAULT,
301 base::Time::Now().LocalMidnight()
302 };
303 base::FilePath user_data_dir; 294 base::FilePath user_data_dir;
304 ASSERT_TRUE(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)); 295 ASSERT_TRUE(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir));
305 ASSERT_TRUE(wallpaper_manager_test_utils::WriteJPEGFile( 296 ASSERT_TRUE(wallpaper_manager_test_utils::WriteJPEGFile(
306 user_data_dir.Append("123"), 297 user_data_dir.Append("123"),
307 wallpaper_manager_test_utils::kWallpaperSize, 298 wallpaper_manager_test_utils::kWallpaperSize,
308 wallpaper_manager_test_utils::kWallpaperSize, 299 wallpaper_manager_test_utils::kWallpaperSize,
309 wallpaper_manager_test_utils::kLargeDefaultWallpaperColor)); 300 wallpaper_manager_test_utils::kLargeDefaultWallpaperColor));
310 WallpaperManager::Get()->SetUserWallpaperInfo(kTestUser1, info, true); 301 WallpaperManager::Get()->SetUserWallpaperInfo(kTestUser1, info, true);
311 } 302 }
312 303
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 358
368 // Same test as WallpaperManagerBrowserTest.UseMigratedWallpaperInfo. But 359 // Same test as WallpaperManagerBrowserTest.UseMigratedWallpaperInfo. But
369 // disabled boot and login animation. 360 // disabled boot and login animation.
370 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation, 361 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTestNoAnimation,
371 PRE_UseMigratedWallpaperInfo) { 362 PRE_UseMigratedWallpaperInfo) {
372 // New user log in, a default wallpaper is loaded. 363 // New user log in, a default wallpaper is loaded.
373 LogIn(kTestUser1, kTestUser1Hash); 364 LogIn(kTestUser1, kTestUser1Hash);
374 // Old wallpaper migration code doesn't exist in codebase anymore. Modify user 365 // Old wallpaper migration code doesn't exist in codebase anymore. Modify user
375 // wallpaper info directly to simulate the wallpaper migration. See 366 // wallpaper info directly to simulate the wallpaper migration. See
376 // crosbug.com/38429 for details about why we modify wallpaper info this way. 367 // crosbug.com/38429 for details about why we modify wallpaper info this way.
377 WallpaperInfo info = { 368 WallpaperInfo info = {"123", WALLPAPER_LAYOUT_CENTER_CROPPED,
378 "123", 369 user_manager::User::DEFAULT,
379 WALLPAPER_LAYOUT_CENTER_CROPPED, 370 base::Time::Now().LocalMidnight()};
380 User::DEFAULT,
381 base::Time::Now().LocalMidnight()
382 };
383 base::FilePath user_data_dir; 371 base::FilePath user_data_dir;
384 ASSERT_TRUE(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)); 372 ASSERT_TRUE(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir));
385 ASSERT_TRUE(wallpaper_manager_test_utils::WriteJPEGFile( 373 ASSERT_TRUE(wallpaper_manager_test_utils::WriteJPEGFile(
386 user_data_dir.Append("123"), 374 user_data_dir.Append("123"),
387 wallpaper_manager_test_utils::kWallpaperSize, 375 wallpaper_manager_test_utils::kWallpaperSize,
388 wallpaper_manager_test_utils::kWallpaperSize, 376 wallpaper_manager_test_utils::kWallpaperSize,
389 wallpaper_manager_test_utils::kLargeDefaultWallpaperColor)); 377 wallpaper_manager_test_utils::kLargeDefaultWallpaperColor));
390 WallpaperManager::Get()->SetUserWallpaperInfo(kTestUser1, info, true); 378 WallpaperManager::Get()->SetUserWallpaperInfo(kTestUser1, info, true);
391 } 379 }
392 380
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 kSmallWallpaperHeight, 471 kSmallWallpaperHeight,
484 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor)); 472 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
485 ASSERT_TRUE(wallpaper_manager_test_utils::WriteJPEGFile( 473 ASSERT_TRUE(wallpaper_manager_test_utils::WriteJPEGFile(
486 large_wallpaper_path, 474 large_wallpaper_path,
487 kLargeWallpaperWidth, 475 kLargeWallpaperWidth,
488 kLargeWallpaperHeight, 476 kLargeWallpaperHeight,
489 wallpaper_manager_test_utils::kLargeDefaultWallpaperColor)); 477 wallpaper_manager_test_utils::kLargeDefaultWallpaperColor));
490 478
491 std::string relative_path = base::FilePath(kTestUser1Hash).Append(id).value(); 479 std::string relative_path = base::FilePath(kTestUser1Hash).Append(id).value();
492 // Saves wallpaper info to local state for user |kTestUser1|. 480 // Saves wallpaper info to local state for user |kTestUser1|.
493 WallpaperInfo info = { 481 WallpaperInfo info = {relative_path, WALLPAPER_LAYOUT_CENTER_CROPPED,
494 relative_path, 482 user_manager::User::CUSTOMIZED,
495 WALLPAPER_LAYOUT_CENTER_CROPPED, 483 base::Time::Now().LocalMidnight()};
496 User::CUSTOMIZED,
497 base::Time::Now().LocalMidnight()
498 };
499 wallpaper_manager->SetUserWallpaperInfo(kTestUser1, info, true); 484 wallpaper_manager->SetUserWallpaperInfo(kTestUser1, info, true);
500 wallpaper_manager->SetUserWallpaperNow(kTestUser1); 485 wallpaper_manager->SetUserWallpaperNow(kTestUser1);
501 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 486 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
502 scoped_ptr<WallpaperManager::TestApi> test_api; 487 scoped_ptr<WallpaperManager::TestApi> test_api;
503 test_api.reset(new WallpaperManager::TestApi(wallpaper_manager)); 488 test_api.reset(new WallpaperManager::TestApi(wallpaper_manager));
504 // Verify SetUserWallpaperNow updates wallpaper cache. 489 // Verify SetUserWallpaperNow updates wallpaper cache.
505 gfx::ImageSkia cached_wallpaper; 490 gfx::ImageSkia cached_wallpaper;
506 EXPECT_TRUE(test_api->GetWallpaperFromCache(kTestUser1, &cached_wallpaper)); 491 EXPECT_TRUE(test_api->GetWallpaperFromCache(kTestUser1, &cached_wallpaper));
507 } 492 }
508 493
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 // SetWallpaperFromImageSkia should update wallpaper cache when multi-profile 529 // SetWallpaperFromImageSkia should update wallpaper cache when multi-profile
545 // is turned on. 530 // is turned on.
546 EXPECT_TRUE(test_api->GetWallpaperFromCache(kTestUser1, &cached_wallpaper)); 531 EXPECT_TRUE(test_api->GetWallpaperFromCache(kTestUser1, &cached_wallpaper));
547 EXPECT_TRUE(cached_wallpaper.BackedBySameObjectAs(red_wallpaper)); 532 EXPECT_TRUE(cached_wallpaper.BackedBySameObjectAs(red_wallpaper));
548 533
549 gfx::ImageSkia green_wallpaper = CreateTestImage(SK_ColorGREEN); 534 gfx::ImageSkia green_wallpaper = CreateTestImage(SK_ColorGREEN);
550 wallpaper_manager->SetCustomWallpaper(kTestUser1, 535 wallpaper_manager->SetCustomWallpaper(kTestUser1,
551 kTestUser1Hash, 536 kTestUser1Hash,
552 "dummy", // dummy file name 537 "dummy", // dummy file name
553 WALLPAPER_LAYOUT_CENTER, 538 WALLPAPER_LAYOUT_CENTER,
554 User::CUSTOMIZED, 539 user_manager::User::CUSTOMIZED,
555 green_wallpaper, 540 green_wallpaper,
556 true); 541 true);
557 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 542 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
558 // SetCustomWallpaper should also update wallpaper cache when multi-profile is 543 // SetCustomWallpaper should also update wallpaper cache when multi-profile is
559 // turned on. 544 // turned on.
560 EXPECT_TRUE(test_api->GetWallpaperFromCache(kTestUser1, &cached_wallpaper)); 545 EXPECT_TRUE(test_api->GetWallpaperFromCache(kTestUser1, &cached_wallpaper));
561 EXPECT_TRUE(cached_wallpaper.BackedBySameObjectAs(green_wallpaper)); 546 EXPECT_TRUE(cached_wallpaper.BackedBySameObjectAs(green_wallpaper));
562 547
563 wallpaper_manager->SetDefaultWallpaperNow(kTestUser1); 548 wallpaper_manager->SetDefaultWallpaperNow(kTestUser1);
564 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 549 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 WallpaperManager::Get()->SetDefaultWallpaperNow(std::string()); 769 WallpaperManager::Get()->SetDefaultWallpaperNow(std::string());
785 770
786 // Custom wallpaper should be applied immediately, canceling the default 771 // Custom wallpaper should be applied immediately, canceling the default
787 // wallpaper load task. 772 // wallpaper load task.
788 gfx::ImageSkia image = wallpaper_manager_test_utils::CreateTestImage( 773 gfx::ImageSkia image = wallpaper_manager_test_utils::CreateTestImage(
789 640, 480, wallpaper_manager_test_utils::kCustomWallpaperColor); 774 640, 480, wallpaper_manager_test_utils::kCustomWallpaperColor);
790 WallpaperManager::Get()->SetCustomWallpaper(chromeos::login::kStubUser, 775 WallpaperManager::Get()->SetCustomWallpaper(chromeos::login::kStubUser,
791 "test_hash", 776 "test_hash",
792 "test-nofile.jpeg", 777 "test-nofile.jpeg",
793 WALLPAPER_LAYOUT_STRETCH, 778 WALLPAPER_LAYOUT_STRETCH,
794 User::CUSTOMIZED, 779 user_manager::User::CUSTOMIZED,
795 image, 780 image,
796 true); 781 true);
797 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 782 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
798 783
799 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( 784 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
800 controller_->GetWallpaper(), 785 controller_->GetWallpaper(),
801 wallpaper_manager_test_utils::kCustomWallpaperColor)); 786 wallpaper_manager_test_utils::kCustomWallpaperColor));
802 787
803 WallpaperManager::Get()->SetDefaultWallpaperNow(std::string()); 788 WallpaperManager::Get()->SetDefaultWallpaperNow(std::string());
804 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished(); 789 wallpaper_manager_test_utils::WaitAsyncWallpaperLoadFinished();
805 790
806 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor( 791 EXPECT_TRUE(wallpaper_manager_test_utils::ImageIsNearColor(
807 controller_->GetWallpaper(), 792 controller_->GetWallpaper(),
808 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor)); 793 wallpaper_manager_test_utils::kSmallDefaultWallpaperColor));
809 } 794 }
810 795
811 } // namespace chromeos 796 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698