BackgroundPlugin::BackgroundPlugin(NPP inst) : SurfaceSubPlugin(inst) { // initialize the drawing surface m_surface = NULL; //initialize bitmap transparency variables mFinishedStageOne = false; mFinishedStageTwo = false; mFinishedStageThree = false; // test basic plugin functionality test_logging(); // android logging test_timers(); // plugin timers test_bitmaps(); // android bitmaps test_domAccess(); test_javascript(); test_loadJavaClass(); //register for touch events ANPEventFlags flags = kTouch_ANPEventFlag; NPError err = browser->setvalue(inst, kAcceptEvents_ANPSetValue, &flags); if (err != NPERR_NO_ERROR) { gLogI.log(kError_ANPLogType, "Error selecting input events."); } }
/*---------------------------------------------------------------------------*/ usys test_full (usys test_num, usys arg) { switch (test_num) { case 0: test_core () ; return GOOD ; case 1: test_speed (arg) ; return GOOD ; case 2: test_timers (arg) ; return GOOD ; case 3: test_msgs (arg) ; return GOOD ; case 4: test_tasks (arg) ; return GOOD ; default: break ; } return GOOD ; } /* End of function test_full() */
int main(int argc, char *argv[]) { bool chook = false; int ferr; int loop = 10; TAD zargs[] = { { "-chook", TA_Bool, TA_NOMAX, &chook }, { "-client", TA_Ign, TA_NOMAX, NULL }, { "-loop", TA_Int, TA_NOMAX, &loop }, { "-maxth", TA_Int, MAX_THR, &maxth }, { "-server", TA_Ign, TA_NOMAX, NULL }, { "-tol", TA_Int, TA_NOMAX, &to_tol }, { "-v", TA_Bool, TA_NOMAX, &verbose }, { "", TA_End, TA_NOMAX, NULL } }; msfs_util_init(&argc, &argv, msg_debug_hook); arg_proc_args(zargs, false, argc, argv); if (chook) msg_debug_hook("c", "c"); util_test_start(true); ferr = msg_mon_process_startup(true); // system messages? TEST_CHK_FEOK(ferr); util_gethostname(my_name, sizeof(my_name)); #if 0 // reproduce bug 1570 // - add sleep(1) in sb_timer_setitimer when pv_to != 0 #endif test_cancel(); test_timers(); test_timers_alloc(); test_thread1(); test_cancel_cb(); test_timers_cb(); test_thread3(); #if 0 // reproduce bug 728 // - must add sleep(1) after call-to-sb_timer_comp_q_remove() in MSG_LISTEN_ test_thread2(); #endif ferr = msg_mon_process_shutdown(); TEST_CHK_FEOK(ferr); util_test_finish(true); return 0; }
int main(void) { queue = queue_create(10, NULL); cfw_service_mgr_init(queue); sanity_test_list(); test_timers(); test_service_init(queue, TEST_SERVICE_ID); pr_info(LOG_MODULE_MAIN, "End of init...."); pr_info(LOG_MODULE_MAIN, "Start of real stuff...\n"); cfw_client_t *c = cfw_client_init(queue, my_handle_message, "Client 1"); //cfw_client_t *c2 = cfw_client_init(queue, my_handle_message, "Client 2"); cfw_open_service_conn(c, TEST_SERVICE_ID, "Conn1"); cfw_open_service_conn(c, TEST_SERVICE_ID, "Conn2"); _cfw_loop(queue); return EXIT_SUCCESS; }