Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: installer/src/installer-lib/test/test-installer-lib-sandbox.cpp

Issue 6003395731128320: Only take into account processes that have our plugin loaded (Closed)
Left Patch Set: Changes for x64 custom action and addressing comments Created March 27, 2014, 11:22 p.m.
Right Patch Set: Simplify Process_Closer constructor Created March 31, 2014, 8:31 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « installer/src/installer-lib/test/test-installer-lib.wxs ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
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" } ; 83 const wchar_t * ABP_names[] = { L"AdblockPlus32.dll", L"AdblockPlus64.dll" } ;
84 Snapshot snapshot ; 84 Snapshot snapshot ;
85 Process_Closer iec( snapshot, IE_names, 2, ABP_names, 2) ; 85 Process_Closer iec( snapshot, IE_names, ABP_names) ;
86 log_single_window_handle_only_if_IE lp( session, iec ) ; 86 log_single_window_handle_only_if_IE lp( session, iec ) ;
87 enumerate_windows( lp ) ; 87 enumerate_windows( lp ) ;
88 } 88 }
89 89
90 //------------------------------------------------------- 90 //-------------------------------------------------------
91 // log_only_window_handle_in_closer 91 // log_only_window_handle_in_closer
92 //------------------------------------------------------- 92 //-------------------------------------------------------
93 void log_only_window_handle_in_closer( Immediate_Session & session ) 93 void log_only_window_handle_in_closer( Immediate_Session & session )
94 { 94 {
95 session.log( "log_only_window_handle_in_closer" ) ; 95 session.log( "log_only_window_handle_in_closer" ) ;
96 const wchar_t * IE_names[] = { L"IExplore.exe", L"AdblockPlusEngine.exe" } ; 96 const wchar_t * IE_names[] = { L"IExplore.exe", L"AdblockPlusEngine.exe" } ;
97 const wchar_t * ABP_names[] = { L"AdblockPlus32.dll", L"AdblockPlus64.dll" } ; 97 const wchar_t * ABP_names[] = { L"AdblockPlus32.dll", L"AdblockPlus64.dll" } ;
98 Snapshot snapshot ; 98 Snapshot snapshot ;
99 Process_Closer iec( snapshot, IE_names, 2, ABP_names, 2) ; 99 Process_Closer iec( snapshot, IE_names, ABP_names) ;
100 iec.iterate_our_windows( log_single_window_handle( session ) ) ; 100 iec.iterate_our_windows( log_single_window_handle( session ) ) ;
101 } 101 }
102 102
103 //------------------------------------------------------- 103 //-------------------------------------------------------
104 // sandbox 104 // sandbox
105 //------------------------------------------------------- 105 //-------------------------------------------------------
106 /** 106 /**
107 * Exposed DLL entry point for custom action. 107 * Exposed DLL entry point for custom action.
108 * The function signature matches the calling convention used by Windows Install er. 108 * The function signature matches the calling convention used by Windows Install er.
109 109
(...skipping 22 matching lines...) Expand all
132 } 132 }
133 catch( ... ) 133 catch( ... )
134 { 134 {
135 session.log_noexcept( "Caught an exception" ) ; 135 session.log_noexcept( "Caught an exception" ) ;
136 return ERROR_INSTALL_FAILURE ; 136 return ERROR_INSTALL_FAILURE ;
137 } 137 }
138 138
139 return ERROR_SUCCESS ; 139 return ERROR_SUCCESS ;
140 } 140 }
141 141
LEFTRIGHT

Powered by Google App Engine
This is Rietveld