~unity-2d-team/unity-2d/trunk

« back to all changes in this revision

Viewing changes to tests/shell/input_shaping.rb

  • Committer: Tarmac
  • Author(s): Albert Astals, Ugo Riboni, Michał Sawicz, Florian Boucault, LDS
  • Date: 2012-02-10 17:32:14 UTC
  • mfrom: (771.3.235 unity-2d-shell_trunk)
  • Revision ID: tarmac-20120210173214-eekg5uiqdb7gjza6
Merge launcher and dash into a common new QML scene: the shell.
 - Created a shell folder that holds both launcher and dash QML code, the C++ code for the single binary and a common folder with shared QML files
 - The shell occupies the whole screen but is shaped for input where it is transparent in order not to interfere with the rest of the windows
 - The shell binary, unity-2d-shell, has a -rootqml option that lets the user specify the QML file to load
 - Implement visibility behaviours in QML instead of C++
 - Do not use D-Bus anymore to communicate between the launcher and the dash
 - Remove the homebutton panel plugin
 - Make the strut setting reusable outside of Unity2dPanel
 - Make LauncherDropItem a FocusScope
 - Implement gesture handling in QML instead of C++

Known issues:
 - In non composited mode there is a 1px wide rectangle on the edge of the screen where the launcher is hidden. This is acceptable for the moment since XFixes barriers to show the launcher are in the plan and will get rid of this problem
 - HomeShortcuts.qml has a transparent Rectangle to fix alignment in RTL mode that causes QML warnings. This is acceptable since the Home lens is going away. Fixes: . Approved by .

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env ruby1.8
 
2
=begin
 
3
/*
 
4
 * This file is part of unity-2d
 
5
 *
 
6
 * Copyright 2011 Canonical Ltd.
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or modify
 
9
 * it under the terms of the GNU General Public License as published by
 
10
 * the Free Software Foundation; version 3.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
=end
 
21
 
 
22
require '../run-tests.rb' unless $INIT_COMPLETED
 
23
require 'xdo/xwindow'
 
24
require 'xdo/keyboard'
 
25
require 'xdo/mouse'
 
26
require 'timeout'
 
27
require 'tmpdir'
 
28
require 'tempfile'
 
29
require $library_path + '/../../shell/input_shaping_common.rb'
 
30
 
 
31
include TDriverVerify
 
32
 
 
33
############################# Test Suite #############################
 
34
context "Shell input shape tests" do
 
35
  pwd = File.expand_path(File.dirname(__FILE__)) + '/'
 
36
 
 
37
  # Run once at the beginning of this test suite
 
38
  startup do
 
39
    $SUT.execute_shell_command 'killall unity-2d-shell'
 
40
    $SUT.execute_shell_command 'killall unity-2d-shell'
 
41
    $SUT.execute_shell_command 'killall unity-2d-panel'
 
42
    $SUT.execute_shell_command 'killall unity-2d-panel'
 
43
 
 
44
    # Need panel running as position of shell depends on it
 
45
    @@panel = $SUT.run(:name => UNITY_2D_PANEL,
 
46
                       :arguments => "-testability" )
 
47
 
 
48
    # Minimize all windows
 
49
    XDo::XWindow.toggle_minimize_all
 
50
  end
 
51
  
 
52
  # Run once at the end of this test suite
 
53
  shutdown do
 
54
  end
 
55
 
 
56
  # Run before each test case begins
 
57
  setup do
 
58
    #Ensure mouse out of the way
 
59
    XDo::Mouse.move(200,200,10,true)
 
60
 
 
61
    # Execute the application 
 
62
    @app = $SUT.run(:name => UNITY_2D_SHELL,
 
63
                    :arguments => "-testability",
 
64
                    :sleeptime => 2)
 
65
    # Make certain application is ready for testing
 
66
    verify(10){ @app.Launcher() }
 
67
  end
 
68
 
 
69
  # Run after each test case completes
 
70
  teardown do
 
71
    $SUT.execute_shell_command 'pkill -nf unity-2d-shell'
 
72
  end
 
73
 
 
74
  #####################################################################################
 
75
  # Test cases
 
76
 
 
77
  test "Shape of launcher alone" do
 
78
    test_shape_of_launcher_alone()
 
79
  end
 
80
 
 
81
  test "Shape of launcher and desktop mode dash" do
 
82
    test_shape_of_launcher_and_desktop_mode_dash()
 
83
  end
 
84
 
 
85
  test "Shape of launcher and fullscreen mode dash" do
 
86
    test_shape_of_launcher_and_fullscreen_mode_dash()
 
87
  end
 
88
 
 
89
  test "Shape of launcher and collapsed desktop mode dash" do
 
90
      test_shape_of_launcher_and_collapsed_desktop_mode_dash()
 
91
  end
 
92
end