OLD | NEW |
1 /** | 1 /** |
2 * \file test-installer-lib-sandbox.cpp | 2 * \file test-installer-lib-sandbox.cpp |
3 * | 3 * |
4 * Automatic testing of many of the units within the custom action is infeasible
. | 4 * Automatic testing of many of the units within the custom action is infeasible
. |
5 * In one case, they rely on the execution environment within an installation se
ssion. | 5 * In one case, they rely on the execution environment within an installation se
ssion. |
6 * In another, they rely on the operation system environment as a whole. | 6 * In another, they rely on the operation system environment as a whole. |
7 * In these cases, it's easier to verify behavior manually. | 7 * In these cases, it's easier to verify behavior manually. |
8 * | 8 * |
9 * This file contains a custom action function sandbox() as well as a number of
test functions. | 9 * This file contains a custom action function sandbox() as well as a number of
test functions. |
10 * At any given time, not all of the test functions need to be referenced within
the body of custom action. | 10 * At any given time, not all of the test functions need to be referenced within
the body of custom action. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 session.log( s.str() ) ; | 73 session.log( s.str() ) ; |
74 } | 74 } |
75 return true ; | 75 return true ; |
76 } | 76 } |
77 } ; | 77 } ; |
78 | 78 |
79 void log_IE_window_handles( Immediate_Session & session ) | 79 void log_IE_window_handles( Immediate_Session & session ) |
80 { | 80 { |
81 session.log( "log_IE_window_handles" ) ; | 81 session.log( "log_IE_window_handles" ) ; |
82 const wchar_t * IE_names[] = { L"IExplore.exe", L"AdblockPlusEngine.exe" } ; | 82 const wchar_t * IE_names[] = { L"IExplore.exe", L"AdblockPlusEngine.exe" } ; |
83 const wchar_t * ABP_names[] = { L"AdblockPlus32.dll", L"AdblockPlus64.dll" } ; | |
84 Process_Snapshot snapshot ; | 83 Process_Snapshot snapshot ; |
85 Process_Closer iec( snapshot, IE_names, ABP_names) ; | 84 Process_Closer iec(snapshot, IE_names) ; |
86 log_single_window_handle_only_if_IE lp( session, iec ) ; | 85 log_single_window_handle_only_if_IE lp( session, iec ) ; |
87 enumerate_windows( lp ) ; | 86 enumerate_windows( lp ) ; |
88 } | 87 } |
89 | 88 |
90 //------------------------------------------------------- | 89 //------------------------------------------------------- |
91 // log_only_window_handle_in_closer | 90 // log_only_window_handle_in_closer |
92 //------------------------------------------------------- | 91 //------------------------------------------------------- |
93 void log_only_window_handle_in_closer( Immediate_Session & session ) | 92 void log_only_window_handle_in_closer( Immediate_Session & session ) |
94 { | 93 { |
95 session.log( "log_only_window_handle_in_closer" ) ; | 94 session.log( "log_only_window_handle_in_closer" ) ; |
96 const wchar_t * IE_names[] = { L"IExplore.exe", L"AdblockPlusEngine.exe" } ; | 95 const wchar_t * IE_names[] = { L"IExplore.exe", L"AdblockPlusEngine.exe" } ; |
97 const wchar_t * ABP_names[] = { L"AdblockPlus32.dll", L"AdblockPlus64.dll" } ; | |
98 Process_Snapshot snapshot ; | 96 Process_Snapshot snapshot ; |
99 Process_Closer iec( snapshot, IE_names, ABP_names) ; | 97 Process_Closer iec( snapshot, IE_names) ; |
100 iec.iterate_our_windows( log_single_window_handle( session ) ) ; | 98 iec.iterate_our_windows( log_single_window_handle( session ) ) ; |
101 } | 99 } |
102 | 100 |
103 //------------------------------------------------------- | 101 //------------------------------------------------------- |
104 // sandbox | 102 // sandbox |
105 //------------------------------------------------------- | 103 //------------------------------------------------------- |
106 /** | 104 /** |
107 * Exposed DLL entry point for custom action. | 105 * Exposed DLL entry point for custom action. |
108 * The function signature matches the calling convention used by Windows Install
er. | 106 * The function signature matches the calling convention used by Windows Install
er. |
109 | 107 |
(...skipping 23 matching lines...) Expand all Loading... |
133 } | 131 } |
134 catch( ... ) | 132 catch( ... ) |
135 { | 133 { |
136 session.log_noexcept( "Caught an exception" ) ; | 134 session.log_noexcept( "Caught an exception" ) ; |
137 return ERROR_INSTALL_FAILURE ; | 135 return ERROR_INSTALL_FAILURE ; |
138 } | 136 } |
139 | 137 |
140 return ERROR_SUCCESS ; | 138 return ERROR_SUCCESS ; |
141 } | 139 } |
142 | 140 |
OLD | NEW |