~vanvugt/ubuntu/quantal/nux/fix-1039155

« back to all changes in this revision

Viewing changes to tests/xtest-hlayout-key-navigation.cpp

  • Committer: Didier Roche
  • Date: 2012-02-17 10:26:11 UTC
  • mfrom: (159.223.89 nux)
  • mto: This revision was merged to the branch mainline in revision 317.
  • Revision ID: didier.roche@canonical.com-20120217102611-evz0toy12hmotgud
Tags: upstream-2.4.0
ImportĀ upstreamĀ versionĀ 2.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "Nux/Nux.h"
22
22
#include "Nux/WindowThread.h"
23
23
#include "Nux/HLayout.h"
 
24
#include "Nux/ProgramFramework/ProgramTemplate.h"
 
25
#include "Nux/ProgramFramework/TestView.h"
24
26
#include <X11/extensions/XTest.h>
25
27
#include <X11/keysym.h> 
26
 
#include "nux_test_framework.h"
27
28
#include "nux_automated_test_framework.h"
28
 
#include "test-view.h"
29
29
 
30
30
unsigned int const NUM_VIEWS = 5;
31
31
unsigned int const ID_UNFOCUSABLE_VIEW = 2; // Please don't make this the last/first one :)
32
32
 
33
 
class HLayoutKeyNavigationTest : public NuxTestFramework
 
33
class HLayoutKeyNavigationTest : public ProgramTemplate
34
34
{
35
35
public:
36
36
  HLayoutKeyNavigationTest(const char* program_name, int window_width, int window_height, int program_life_span);
45
45
  TestView* views_[NUM_VIEWS];
46
46
};
47
47
 
48
 
HLayoutKeyNavigationTest::HLayoutKeyNavigationTest(const char *program_name,
 
48
HLayoutKeyNavigationTest::HLayoutKeyNavigationTest(const char* program_name,
49
49
                                                   int window_width,
50
50
                                                   int window_height,
51
51
                                                   int program_life_span)
52
 
  : NuxTestFramework(program_name, window_width, window_height, program_life_span)
 
52
: ProgramTemplate(program_name, window_width, window_height, program_life_span)
53
53
{
54
54
}
55
55
 
89
89
  static_cast<nux::WindowThread*>(window_thread_)->SetWindowBackgroundPaintLayer(&background);
90
90
}
91
91
 
92
 
HLayoutKeyNavigationTest *key_navigation_test = NULL;
 
92
HLayoutKeyNavigationTest* key_navigation_test = NULL;
93
93
 
94
 
void TestingThread(nux::NThread *thread, void *user_data)
 
94
void TestingThread(nux::NThread* thread, void* user_data)
95
95
{
96
96
  while (key_navigation_test->ReadyToGo() == false)
97
97
  {
101
101
 
102
102
  nux::SleepForMilliseconds(1000);
103
103
 
104
 
  nux::WindowThread *wnd_thread = static_cast<nux::WindowThread*>(user_data);
 
104
  nux::WindowThread* wnd_thread = static_cast<nux::WindowThread*>(user_data);
105
105
 
106
106
  NuxAutomatedTestFramework test(wnd_thread);
107
107
 
179
179
  nuxDebugMsg("Exit testing thread");
180
180
}
181
181
 
182
 
int main(int argc, char **argv)
 
182
int main(int argc, char** argv)
183
183
{
184
184
  int xstatus = XInitThreads();
185
185
  nuxAssertMsg(xstatus > 0, "XInitThreads has failed");