'Set the video closed captioning visibility state.
Arguments:
closed_captions_new_state (bool): True means show closed captioning'

@wait_for_js
def _closed_captions_visibility(self, closed_captions_new_state):

    states = {True: 'shown', False: 'hidden'}
    state = states[closed_captions_new_state]
    self.click_player_button('cc_button')
    EmptyPromise((lambda : (self.is_closed_captions_visible() == closed_captions_new_state)), 'Closed    captions    are    {state}'.format(state=state)).fulfill()
