Chromium Code Reviews

Side by Side Diff: third_party/xdg-utils/tests/xdg-utils-usecases/t.14-desktop_menu_icon

Issue 151098: Patch from mdm@google.com... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « third_party/xdg-utils/tests/xdg-utils-usecases/t.11-desktop_file_icon ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Name: svn:executable
+ *
OLDNEW
(Empty)
1 #!/bin/bash
2
3 . "$XDG_TEST_DIR/include/testassertions.sh"
4 . "$XDG_TEST_DIR/include/testcontrol.sh"
5
6 test_desktop_menu_icon() {
7
8 test_start "$FUNCNAME: ensure that icons show up correctly in menu."
9
10 ICON_SIZES="16 22 24 32 48 64 128"
11
12 test_init
13
14 # get icon files
15 for i in $ICON_SIZES; do
16 use_file "$XDG_TEST_DIR/icons/red-$i.png" TMP
17 done
18
19 # get & edit desktop file
20 use_file "$XDG_TEST_DIR/xdg-utils-usecases/data/icon_test.desktop" DESKTOP
21 use_file "$XDG_TEST_DIR/xdg-utils-usecases/data/menu_item_dummy.desktop" DESKTOP 2
22 use_file "$XDG_TEST_DIR/xdg-utils-usecases/data/menu_install.directory" DIRECTOR Y
23
24 edit_file "$DESKTOP" 'Icon Test' ITEM_TEXT "TEST $XDG_TEST_SHORTID"
25 edit_file "$DESKTOP" 'red' ICON_NAME "red-$XDG_TEST_SHORTID"
26
27 edit_file "$DIRECTORY" 'XDG UTILS TEST' MENU_NAME "MENU $XDG_TEST_SHORTID"
28 edit_file "$DIRECTORY" 'red' ICON_NAME "red-$XDG_TEST_SHORTID"
29
30 assert_file "$DESKTOP"
31 assert_file "$DESKTOP2"
32 assert_file "$DIRECTORY"
33
34 test_procedure
35
36 # install icons of all sizes
37 for i in $ICON_SIZES; do
38 assert_exit 0 xdg-icon-resource install --size "$i" "xdgtestdata-$XDG_TE ST_ID-red-$i.png" "$ICON_NAME"
39 assert_nostdout
40 assert_nostderr
41 done
42
43 assert_exit 0 xdg-desktop-menu install "$DIRECTORY" "$DESKTOP" "$DESKTOP2"
44 assert_nostdout
45 assert_nostderr
46
47 # Wait a little for caches to update
48 sleep 1
49
50 assert_interactive "Is there a menu in <main> called '$MENU_NAME'?" y
51 assert_interactive "Does the menu '$MENU_NAME' have a red number as its icon?" y
52 assert_interactive "Does the menu entry '$ITEM_TEXT' in '<main>/$MENU_NAME' have a red number as its icon?" y
53
54 ## cleanup
55
56 xdg-desktop-menu uninstall "$DIRECTORY" "$DESKTOP" "$DESKTOP2" > /dev/null 2> /d ev/null
57
58 # remove icons
59 for i in $ICON_SIZES; do
60 xdg-icon-resource uninstall --size "$i" "$ICON_NAME" > /dev/null 2> /dev /null
61 done
62
63 test_result
64 }
65
66 run_test test_desktop_menu_icon
OLDNEW
« no previous file with comments | « third_party/xdg-utils/tests/xdg-utils-usecases/t.11-desktop_file_icon ('k') | no next file » | no next file with comments »

Powered by Google App Engine