Lines Matching defs:job

5 // This file contains unit tests for the job object.
8 #include "sandbox/win/src/job.h"
13 // Tests the creation and destruction of the job.
17 // Create the job.
18 Job job;
19 ASSERT_EQ(ERROR_SUCCESS, job.Init(JOB_LOCKDOWN, L"my_test_job_name", 0, 0));
21 // check if the job exists.
30 // Check if the job is destroyed when the object goes out of scope.
41 // Create the job.
42 Job job;
43 ASSERT_EQ(ERROR_SUCCESS, job.Init(JOB_LOCKDOWN, L"my_test_job_name", 0, 0));
45 job_handle = job.Detach();
49 // Check to be sure that the job is still alive even after the object is gone
73 // Create the job.
74 Job job;
75 ASSERT_EQ(ERROR_SUCCESS, job.Init(JOB_LOCKDOWN, L"my_test_job_name",
78 job_handle = job.Detach();
94 // Create the job.
95 Job job;
96 ASSERT_EQ(ERROR_SUCCESS, job.Init(JOB_LOCKDOWN, L"my_test_job_name", 0, 0));
98 job_handle = job.Detach();
114 // Tests the error case when the job is initialized twice.
116 // Create the job.
117 Job job;
118 ASSERT_EQ(ERROR_SUCCESS, job.Init(JOB_LOCKDOWN, L"my_test_job_name", 0, 0));
119 ASSERT_EQ(ERROR_ALREADY_INITIALIZED, job.Init(JOB_LOCKDOWN, L"test", 0, 0));
125 Job job;
126 ASSERT_EQ(ERROR_NO_DATA, job.UserHandleGrantAccess(NULL));
127 ASSERT_EQ(ERROR_NO_DATA, job.AssignProcessToJob(NULL));
128 ASSERT_TRUE(job.Detach() == NULL);
131 // Tests the initialization of the job with different security level.
148 // JOB_NONE means we run without a job object so Init should fail.
159 // Create the job.
160 Job job;
161 ASSERT_EQ(ERROR_SUCCESS, job.Init(JOB_UNPROTECTED, L"job_test_process", 0,
173 ASSERT_EQ(ERROR_SUCCESS, job.AssignProcessToJob(pi.process_handle()));
175 // Get the job handle.
176 HANDLE job_handle = job.Detach();
178 // Check if the process is in the job.