Back to index

nux  3.0.0
Classes | Functions | Variables
xtest-scrollbar.cpp File Reference
#include "Nux/Nux.h"
#include "Nux/WindowThread.h"
#include "Nux/VLayout.h"
#include "Nux/ProgramFramework/ProgramTemplate.h"
#include "Nux/ProgramFramework/TestView.h"
#include <X11/extensions/XTest.h>
#include <X11/keysym.h>
#include "nux_automated_test_framework.h"
#include "test-scrollview.h"

Go to the source code of this file.

Classes

class  ScrollBarTest

Functions

void TestingThread (nux::NThread *thread, void *user_data)
int main (int argc, char **argv)

Variables

ScrollBarTestscrollbar_test

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 116 of file xtest-scrollbar.cpp.

{
  int xstatus = XInitThreads();
  nuxAssertMsg(xstatus > 0, "XInitThreads has failed");

  scrollbar_test = new ScrollBarTest("Scrollbar Test", 500, 400, 13000);
  scrollbar_test->Startup();
  scrollbar_test->UserInterfaceSetup();

  nux::SystemThread* test_thread = nux::CreateSystemThread(scrollbar_test->GetWindowThread(), &TestingThread, scrollbar_test->GetWindowThread());

  test_thread->Start(scrollbar_test);

  scrollbar_test->Run();

  delete test_thread;
  delete scrollbar_test;

  return 0;
}

Here is the call graph for this function:

void TestingThread ( nux::NThread thread,
void *  user_data 
)

Definition at line 80 of file xtest-scrollbar.cpp.

{
  while (scrollbar_test->ReadyToGo() == false)
  {
    nuxDebugMsg("Waiting to start");
    nux::SleepForMilliseconds(300);
  }
  nux::SleepForMilliseconds(1000);

  nux::WindowThread* wnd_thread = static_cast<nux::WindowThread*>(user_data);
  NuxAutomatedTestFramework test(wnd_thread);
  test.Startup();

  test.TestReportMsg(scrollbar_test->scroll_view_, "TestScrollView created");
  
  scrollbar_test->scroll_view_->ResetEvents();
  test.ViewSendMouseMotionToCenter(scrollbar_test->scroll_view_);
  test.ViewSendMouseClick(scrollbar_test->scroll_view_, 4);
  nux::SleepForMilliseconds(1000);
  test.TestReportMsg(scrollbar_test->scroll_view_->registered_scroll_, "Scroll on the center of the scrollview");
  
  
  scrollbar_test->scroll_view_->ResetEvents();
  test.ViewSendMouseMotionToCenter(scrollbar_test->scroll_view_->GetVScrollbar());
  test.ViewSendMouseClick(scrollbar_test->scroll_view_->GetVScrollbar(), 4);
  nux::SleepForMilliseconds(1000);
  test.TestReportMsg(scrollbar_test->scroll_view_->registered_scroll_, "Scroll on the scrollbar");

  if (test.WhenDoneTerminateProgram())
  {
    nux::SleepForMilliseconds(1000);
    wnd_thread->ExitMainLoop();
  }
  nuxDebugMsg("Exit testing thread");
}

Here is the call graph for this function:


Variable Documentation

Definition at line 78 of file xtest-scrollbar.cpp.